From 16eb120253efa86e7c5fa548e03de321a5b54a1b Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 31 Oct 2020 14:10:53 +0100 Subject: Little bit of sanitizing... --- app/Http/Controllers/PagesController.php | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'app/Http/Controllers/PagesController.php') diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index c30f923..ebd6b13 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -20,8 +20,10 @@ class PagesController extends Controller public function news(Request $request) { - $news = Post::all(); + $news = Post::orderBy('created_at', 'desc')->get(); + //$data = ['news' => $news]; + //return view('pages.news')->with($data); //return view('pages.news')->with('news', $news); return view('pages.news', compact('news')); } @@ -79,24 +81,4 @@ class PagesController extends Controller Auth::logout(); return Redirect::back(); } - - // NOTES - //public function services() - //{ - ////$title = 'Some title'; - ////return view('pages.index', compact('title')); - //$data = [ - //'title' => 'Services', - //'services' => ['Web design', 'Programming', 'SEO'] - //]; - //return view('pages.services')->with($data); - //} - - //public function about() - //{ - ////$title = 'About'; - ////return view('pages.index')->with('title', $title); - //$data = ['title' => 'About']; - //return view('pages.index')->with($data); - //} } -- cgit v1.2.3