示例#1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($slug)
 {
     $thread = Thread::findBySlug($slug);
     Thread::destroy($thread->id);
     return Redirect::route('thread.index');
 }
示例#2
0
 public function index()
 {
     $threads = Thread::paginate(10)->sortByDesc('id');
     $cats = Category::all();
     return view('site.index', ['threads' => $threads, 'cats' => $cats]);
 }