/**
  * Store a newly created resource in storage.
  *
  * @param Requests\CreateEditSliderRequest $request
  * @param StoreFile $storeFile
  * @param \App\Slider $slider
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(Requests\CreateEditSliderRequest $request, StoreFile $storeFile, \App\Slider $slider)
 {
     //Creating and moving the file image
     $image_path = $storeFile->move($request->file('image'), 'public/images/sliders/', 16);
     //Adding the image file path to the array of request
     $modified_request = array_merge($request->except('image'), ['image' => $image_path]);
     //Storing
     $slider->create($modified_request);
     //Redirect
     return redirect()->action('Panel\\SliderController@index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\Council\EditCouncilRequest $request, $id, StoreFile $storeFile)
 {
     if ($request->hasFile('image')) {
         $image_path = $storeFile->move($request->file('image'), 'images/council/', 16);
         $modified_request = array_merge($request->all(), ['image' => $image_path]);
     } else {
         $modified_request = $request->except('image');
     }
     (new \App\Council())->findOrFail($id)->update($modified_request);
     return redirect()->action('Panel\\Configs\\CouncilController@index');
 }
 public function update(Requests\Pages\EditPageRequest $request, $id, StoreFile $storeFile, \App\Page $page)
 {
     if ($request->hasFile('image')) {
         $image_path = $storeFile->move($request->file('image'), 'images/pages/', 16);
         $modified_request = array_merge($request->all(), ['image' => $image_path]);
     } else {
         $modified_request = $request->except('image');
     }
     $page->findOrFail($id)->update($modified_request);
     //Redirect
     return redirect()->action('Panel\\PagesController@index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\Products\EditProductRequest $request, $id, StoreFile $storeFile, \App\Product $product)
 {
     if ($request->hasFile('image')) {
         $image_path = $storeFile->move($request->file('image'), 'images/products/', 16);
         $modified_request = array_merge($request->all(), ['image' => $image_path]);
     } else {
         $modified_request = $request->except('image');
     }
     $product->findOrFail($id)->update($modified_request);
     if ($request->hasFile('sub-image')) {
         $sub_image_path = $storeFile->move($request->file('sub-image'), 'images/gallery/products/', 16);
         (new \App\Gallery())->create(['resource' => 'product', 'resource_id' => $id, 'image' => $sub_image_path]);
     }
     return redirect()->action('Panel\\ProductsController@index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\Sections\EditSectionRequest $request, $id, StoreFile $storeFile, \App\Section $section)
 {
     if ($request->hasFile('image')) {
         //Creating and moving the file image
         $image_path = $storeFile->move($request->file('image'), 'public/images/sections/', 16);
         //Adding the image file path to the array of request
         $modified_request = array_merge($request->except('image'), ['image' => $image_path]);
     } else {
         $modified_request = $request->except('image');
     }
     //Storing
     $section->findOrFail($id)->update($modified_request);
     //Redirect
     return redirect()->action('Panel\\SectionsController@index');
 }