From d8219a9fb5454aaf0bb2e24dcc1d41dca7dae975 Mon Sep 17 00:00:00 2001 From: horus Date: Wed, 8 Apr 2020 07:03:20 +0200 Subject: Fix search page. --- app/Http/Controllers/IndexController.php | 2 ++ resources/views/list.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/IndexController.php b/app/Http/Controllers/IndexController.php index 7ae362a..dbbbfb1 100644 --- a/app/Http/Controllers/IndexController.php +++ b/app/Http/Controllers/IndexController.php @@ -69,6 +69,8 @@ class IndexController extends Controller }); } $count = $articles->count(); + + $articles = $articles->orderBy('impact', 'desc'); $articles = $articles->orderBy('created_at', 'desc'); $articles = $articles->simplePaginate(10); diff --git a/resources/views/list.blade.php b/resources/views/list.blade.php index 82d53e5..5a5949a 100644 --- a/resources/views/list.blade.php +++ b/resources/views/list.blade.php @@ -60,7 +60,7 @@ html { @else

- Most {{ ucwords(Request::route()->getName()) }} Articles + {{ ucwords(Request::route()->getName()) }} Articles @if ( "1" != $articles->currentPage() ) (Page {{ $articles->currentPage() }}) @endif @@ -120,7 +120,7 @@ html {
@endforeach - {{ $articles->links() }} + {{ $articles->appends(Request::input())->links() }} @endsection -- cgit v1.2.3