/** * 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')); }
public function index() { $tweets = Tweet::with('user')->latest('created_at')->get(); //$tweets = Tweet::orderBy('created_at', 'desc')->get(); return view('tweets.index', compact('tweets')); }