public function destroy($cat)
 {
     $cate = Category::findBySlug($cat);
     Category::destroy($cate->id);
     return Redirect::route('site.index');
 }
Example #2
0
 /**
  * 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]);
 }
Example #3
0
 public function index()
 {
     $threads = Thread::paginate(10)->sortByDesc('id');
     $cats = Category::all();
     return view('site.index', ['threads' => $threads, 'cats' => $cats]);
 }