コード例 #1
0
 public function postDestroy()
 {
     $category = Category::find(Input::get('id'));
     if ($category) {
         $category->delete();
         return Redirect::to('admin/categories/index')->with('message', 'Category Deleted');
     }
     return Redirect::to('admin/categories/index')->with('message', 'Something went wrong, please try again!');
 }
コード例 #2
0
 public function getCategory($cat_id)
 {
     return View::make('store.category')->with('products', Product::where('category_id', '=', $cat_id)->paginate(6))->with('category', Category::find($cat_id));
 }