public function __construct() { $this->data['categories'] = Products\Category::where('status', '!=', 0)->GetNested(); $this->data['products'] = Products\Product::where('product_status', '!=', 0)->take(shopOpt('product_perpage_front'))->get(); $this->data['mtop'] = Page\Page::where('page_status', 1)->where('page_position', '=', 'top')->GetNested('top'); $this->data['mbottom'] = Page\Page::where('page_status', 1)->where('page_position', '=', 'bottom')->GetNested('bottom'); $this->data['slideshow'] = Widget\Slideshow::where('ss_status', 1)->orderBy('ss_order')->get(); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // if (!Entrust::can('slideshow-delete')) { $this->data['slideshow'] = Slideshow::all(); return view('backend.slideshow.lists', $this->data); } $slideshow = Slideshow::find($id); if (Storage::exists('slideshows/thumb/' . $slideshow->ss_image)) { Storage::delete('slideshows/thumb/' . $slideshow->ss_image); } if (Storage::exists('slideshows/full/' . $slideshow->ss_image)) { Storage::delete('slideshows/full/' . $slideshow->ss_image); } if ($slideshow->delete()) { $this->data['slideshow'] = Slideshow::all(); return view('backend.slideshow.lists', $this->data); } }