summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorus2020-04-08 07:03:20 +0200
committerhorus2020-04-08 07:03:20 +0200
commitd8219a9fb5454aaf0bb2e24dcc1d41dca7dae975 (patch)
tree9ac0c9ef7e0be585b4570faea894d6a3ba76f878
parent5a8c47e29afdbb61c32c1e03162abb1bb871ee9e (diff)
downloadcurious-d8219a9fb5454aaf0bb2e24dcc1d41dca7dae975.tar.gz
Fix search page.
-rw-r--r--app/Http/Controllers/IndexController.php2
-rw-r--r--resources/views/list.blade.php4
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 {
</div>
@else
<h1 class="card-header">
- Most {{ ucwords(Request::route()->getName()) }} Articles
+ {{ ucwords(Request::route()->getName()) }} Articles
@if ( "1" != $articles->currentPage() )
(Page {{ $articles->currentPage() }})
@endif
@@ -120,7 +120,7 @@ html {
<div style="margin-bottom: 20px"></div>
@endforeach
- {{ $articles->links() }}
+ {{ $articles->appends(Request::input())->links() }}
</div>
@endsection