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!'); }
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)); }