/** * Display a listing of the resource. * * @return Response */ public function index() { $posts = Post::whereActive(1)->orderBy('created_at', 'desc')->paginate(5); return view('home')->withPosts($posts)->withTitle('Latest Posts'); }