diff options
author | Mateja <mail@matejamaric.com> | 2020-11-06 17:34:30 +0100 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2020-11-06 17:34:30 +0100 |
commit | 34b559e17e7896ca5b19221187f77c063b68d8eb (patch) | |
tree | 9f06c42d98f1d685bb4aef40d6f8bc9f934121ee /app/Http/Controllers/NewsController.php | |
parent | 7af18c65418027a4cc1cb9fe71f11489029c3912 (diff) | |
download | yota-laravel-34b559e17e7896ca5b19221187f77c063b68d8eb.tar.gz yota-laravel-34b559e17e7896ca5b19221187f77c063b68d8eb.zip |
Paginate news.
Diffstat (limited to 'app/Http/Controllers/NewsController.php')
-rw-r--r-- | app/Http/Controllers/NewsController.php | 2 |
1 files changed, 1 insertions, 1 deletions
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); |