Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
a714629abd
  1. 7
      app/Http/Controllers/SearchController.php
  2. 1
      routes/web.php

7
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,[

1
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']);
Loading…
Cancel
Save