Exemplo n.º 1
0
 /**
  * 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');
 }
Exemplo n.º 2
0
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('includes.latestnews', function ($view) {
         $view->with('news', News::latest()->take(5)->get());
     });
 }
Exemplo n.º 3
0
 public function article($slug)
 {
     Carbon::setLocale('nl');
     $article = News::where('slug', $slug)->first();
     return view('pages.public.article')->with('article', $article);
 }