/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $news = News::findOrFail($id); $news->delete(); \Flash::success('Nieuwsartikel verwijderd'); return redirect('admin/news'); }
/** * Bootstrap any application services. * * @return void */ public function boot() { view()->composer('includes.latestnews', function ($view) { $view->with('news', News::latest()->take(5)->get()); }); }
public function article($slug) { Carbon::setLocale('nl'); $article = News::where('slug', $slug)->first(); return view('pages.public.article')->with('article', $article); }