Exemplo n.º 1
0
 public function filter($gallerySerie_id)
 {
     $galleryImages = GalleryImage::where('serie_id', '=', $gallerySerie_id)->orderBy('position')->get();
     $gallerySerie = GallerySerie::where('id', '=', $gallerySerie_id)->firstOrFail();
     return view('gallery.images.index', compact('galleryImages', 'gallerySerie', 'gallerySerie_id'));
 }
Exemplo n.º 2
0
 public function destroy($id)
 {
     $image = $this->getById($id);
     $gallerySerie = GallerySerie::where('id', '=', $image->serie_id)->firstOrFail();
     $galleryCategory = GalleryCategory::where('id', '=', $gallerySerie['category_id'])->firstOrFail();
     $path = public_path() . config('gallery.path') . $galleryCategory['slug'] . '/' . $gallerySerie['slug'];
     $file = $path . '/' . $id . '.' . $image->extension;
     $thumb = $path . '/' . $id . '_thumb.' . $image->extension;
     if (is_file($file)) {
         unlink($file);
     }
     if (is_file($thumb)) {
         unlink($thumb);
     }
     $this->getById($id)->delete();
 }
Exemplo n.º 3
0
 public function filter($category_id)
 {
     $gallerySeries = GallerySerie::where('category_id', '=', $category_id)->orderBy('position')->get();
     $galleryCategories = GalleryCategory::lists('name', 'id');
     return view('gallery-series.index', compact('gallerySeries', 'galleryCategories', 'category_id'));
 }