예제 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //$tweet = Tweet::findOrFail($id);
     $tweet = Tweet::with('user')->findOrFail($id);
     return view('tweets.show', compact('tweet'));
 }
예제 #2
0
 public function index()
 {
     $tweets = Tweet::with('user')->latest('created_at')->get();
     //$tweets = Tweet::orderBy('created_at', 'desc')->get();
     return view('tweets.index', compact('tweets'));
 }