diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 6ff766e..14836da 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -18,6 +18,13 @@ use Kyslik\ColumnSortable\Sortable; class SearchController extends Controller { + public function index(Result $result) + { + $results = $result->sortable()->paginate(10); + + return view('search.results')->with('results', $results); + } + public function search(Request $request){ // validation $this->validate($request,[ diff --git a/routes/web.php b/routes/web.php index f1c89c3..272500f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -41,3 +41,4 @@ Route::get('/yeast/{yeastID}', [App\Http\Controllers\YeastcardController::class, Route::get('/hop/{hopID}', [App\Http\Controllers\HopcardController::class, 'index'])->name('hop'); Route::get('/adjunct/{adjunctID}', [App\Http\Controllers\AdjunctcardController::class, 'index'])->name('adjunct'); Route::post('/search/results/{searchword}', [App\Http\Controllers\SearchController::class, 'search'])->name('search.results'); +Route::get('search.results', [App\Http\Controllers\SearchController::class, 'index']);