From 34b559e17e7896ca5b19221187f77c063b68d8eb Mon Sep 17 00:00:00 2001 From: Mateja Date: Fri, 6 Nov 2020 17:34:30 +0100 Subject: Paginate news. --- app/Http/Controllers/NewsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Http/Controllers') diff --git a/app/Http/Controllers/NewsController.php b/app/Http/Controllers/NewsController.php index 306066c..de7a823 100644 --- a/app/Http/Controllers/NewsController.php +++ b/app/Http/Controllers/NewsController.php @@ -19,7 +19,7 @@ class NewsController extends Controller */ public function index() { - $news = Post::orderBy('created_at', 'desc')->get(); + $news = Post::orderBy('created_at', 'desc')->paginate(6); //$data = ['news' => $news]; //return view('pages.news')->with($data); -- cgit v1.2.3