app/Http/Controllers/SliderController.php
/**
   * Creates new slides binded to slider entity
   * also creates image files with different size
   *
   * @param $slider
   * @param $request
   */
Creates new slides binded to slider entity
also creates image files with different size

@param $slider
@param $request
Creates new slides binded to slider entity also creates image files with different size @param $slider @param $request
private function createNewSlides($slider, $request) {
    $files = $request->file('image');
    if(isset($files[0])){
      foreach ($files as $file){
        $fileName = $this->updatefilename($file);
        $slide = new Slide(array(
          'title' =>  $request->get('slide_title'),
          'alt' => $request->get('alt'),
          'image' => $fileName,
          'slider_id' => $slider->id,
        ));
        $slide->save();
        $this->createSlideImage($file, $fileName, $slider->id);
      }
    }
  }
private function createNewSlides ( $ slider , $ request ) { $ files = $ request -> file ( 'image' ) ; if ( isset ( $ files [ 0 ] ) ) { foreach ( $ files as $ file ) { $ fileName = $ this -> updatefilename ( $ file ) ; $ slide = new Slide ( array ( 'title' => $ request -> get ( 'slide_title' ) , 'alt' => $ request -> get ( 'alt' ) , 'image' => $ fileName , 'slider_id' => $ slider -> id , ) ) ; $ slide -> save ( ) ; $ this -> createSlideImage ( $ file , $ fileName , $ slider -> id ) ; } } }
Creates new slides binded to slider entity
 also creates image files with different size
Creates new slides binded to slider entity also creates image files with different size
//getting all files