Exemplo n.º 1
0
 public function getNeighborhood()
 {
     $images = FilterImage::all();
     $filter = Filter::take(1)->get()[0];
     $filters = Filter::all();
     return View::make('site.neighborhood', array('images' => $images, 'text' => $filter->text, 'paragraph_title' => $filter->paragraph_title, 'filters' => $filters));
 }
 public function run()
 {
     DB::table('filter_images')->delete();
     $success = File::cleanDirectory($this->getImagesPath());
     File::put($this->getImagesPath() . '.gitignore', File::get(public_path() . '/../app/storage/cache/.gitignore'));
     // Create images for all filters. In this phase images for all the filter will be the same
     $filters = Filter::all();
     foreach ($filters as $filter) {
         FilterImage::create(['filter_id' => $filter->id, 'image_name' => $this->copyImage(public_path() . '/backup_images/filters/gym.jpg')]);
         //            FilterImage::create([
         //                'filter_id' => $filter->id,
         //                'image_name' => $this->copyImage(public_path().'/backup_images/filters/hero.jpg')
         //            ]);
         //
         //            FilterImage::create([
         //                'filter_id' => $filter->id,
         //                'image_name' => $this->copyImage(public_path().'/backup_images/filters/kitchen.jpg')
         //            ]);
         //
         //            FilterImage::create([
         //                'filter_id' => $filter->id,
         //                'image_name' => $this->copyImage(public_path().'/backup_images/filters/living.jpg')
         //            ]);
     }
 }
Exemplo n.º 3
0
 public function deleteDutchKillsImage($id)
 {
     $filterImage = FilterImage::find($id);
     $path = FilterImage::IMAGES_FOLDER . $filterImage->image_name;
     $filterImage->delete();
     $this->deleteImageFromFileSystem($path);
 }