public function index() { $articles = Article::latest('published_at')->published()->get(); return view('articles.index', compact('articles')); }
/** * Bootstrap the application services. * * @return void */ public function boot() { view()->composer('articles.partials.nav', function ($view) { $view->with('latest', Article::latest()->first()); }); }