public function destroy($id) { $serie = GallerySerie::with('category')->where('id', '=', $id)->firstOrFail(); $path = public_path() . config('gallery.path') . $serie->category->slug . '/' . $serie->slug; $this->removeDirectory($path); $this->getById($id)->delete(); }
public function index() { $gallerySeries = GallerySerie::with('category')->orderBy('position')->get(); return view('gallery.series.index', compact('gallerySeries')); }