コード例 #1
0
ファイル: Controller.php プロジェクト: udibagas/lara-shop
 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();
 }
コード例 #2
0
ファイル: CategoryCtrl.php プロジェクト: udibagas/lara-shop
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     if (!Entrust::can('category-update')) {
         return redirect('');
     }
     $this->data['sub_title'] = 'Edit Category';
     $this->data['category'] = Category::find($id);
     $this->data['parent'] = Category::where('id', '!=', $id)->where('parent', '=', 0)->lists('name', 'id');
     return view('backend.category.edit', $this->data);
 }
コード例 #3
0
ファイル: ProductCtrl.php プロジェクト: udibagas/lara-shop
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     if (!Entrust::can('product-update')) {
         return redirect('');
     }
     $this->data['sub_title'] = 'Edit Product';
     $this->data['product'] = Product::find($id);
     $this->data['category'] = Category::where('status', 1)->lists('name', 'id');
     return view('backend.product.edit', $this->data);
 }