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