예제 #1
0
 public function subproduct($slug, $subcategory)
 {
     $this->data['css_assets'] = Assets::load('css', ['lib-bootstrap', 'style', 'font-awesome', 'font-awesome-min', 'flexslider', 'color-schemes-core', 'color-schemes-turquoise', 'jquery-parallax', 'bootstrap-responsive', 'font-family']);
     $this->data['js_assets'] = Assets::load('js', ['jquery', 'jquery-ui', 'jquery-easing', 'bootstrap-min-lib', 'jquery-isotope', 'jquery-flexslider', 'jquery.elevatezoom', 'jquery-sharrre', 'jquery-gmap3', 'imagesloaded', 'la_boutique', 'jquery-cookie', 'jquery-parallax-lib']);
     $this->data['slugcategory'] = Category::where('slug', $slug)->first();
     $this->data['slugsubcategory'] = Subcategory::where('slug', $subcategory)->first();
     //$this->data['banner']		= Option::where('meta_key','banner_'.$slug)->first();
     //$this->data['title']		= $this->data['slugsubcategory']->name;
     if ($this->data['slugcategory'] == NULL || $this->data['slugsubcategory'] == NULL) {
         $this->data['title'] = '404 - not found';
         $this->data['message'] = 'Subcategory that you looking for is not found or has been removed';
         return view('main_layout')->with('data', $this->data)->nest('content', 'error/404_product', array('data' => $this->data));
     } else {
         $this->data['banner'] = Option::where('meta_key', 'banner_' . $slug)->first();
         $this->data['title'] = ucwords($this->data['slugcategory']->name) . ' - ' . $this->data['slugsubcategory']->subname;
         return view('main_layout')->with('data', $this->data)->nest('content', 'product/product', array('data' => $this->data));
     }
 }
예제 #2
0
 public function category_content(Request $request)
 {
     $this->data['subcategory'] = Subcategory::where('category_id', $request->id)->get();
     return view('admin/setting/subcategory_content')->with('data', $this->data);
 }
예제 #3
0
 public function delete_subcategory($id)
 {
     Subcategory::find($id)->delete();
     return redirect('master/setting/subcategory/list');
 }
예제 #4
0
 public function get_list_subcategory(Request $request)
 {
     $subcategory = Subcategory::where('category_id', $request->category_id)->get();
     return $subcategory;
 }