public function destroy($cat) { $cate = Category::findBySlug($cat); Category::destroy($cate->id); return Redirect::route('site.index'); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($slug) { $cats = Category::all(); $thread = Thread::findBySlug($slug); return view('threads.edit', ['cats' => $cats, 'thread' => $thread]); }
public function index() { $threads = Thread::paginate(10)->sortByDesc('id'); $cats = Category::all(); return view('site.index', ['threads' => $threads, 'cats' => $cats]); }