Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
cee3a95b39
  1. 7
      app/Http/Controllers/SearchController.php
  2. 9
      public/css/jk.css
  3. 6
      resources/views/search/index.blade.php

7
app/Http/Controllers/SearchController.php

@ -18,13 +18,6 @@ use Kyslik\ColumnSortable\Sortable;
class SearchController extends Controller
{
public function index(Summarie $beer)
{
$results = $beer->sortable()->paginate(10);
return view('search.results')->with('results', $results);
}
public function search(Request $request){
// validation
$this->validate($request,[

9
public/css/jk.css

@ -20,6 +20,15 @@
.editbutton, .deletebutton{
display:inline-block;
}
#search-form input[type="text"], #search-form input[type="radio"], #search-form label{
display:inline;
}
#search-form input[type="radio"]{
font-size: 12px;
}
@media only screen and (orientation: portrait){
.hideable{

6
resources/views/search/index.blade.php

@ -1,8 +1,8 @@
<form method="post" action="{{ route('search.results') }}">
<form method="post" action="{{ route('search.results') }}" id="search-form">
@csrf
<div class="form-group">
<label for="search">Search</label>
<input type="text" class="form-control" name="search" >
<input type="text" class="form-control" name="search" /><button type="submit" class="btn btn-primary">Search</button>
</div>
<div class="form-group">
<legend>Select table: </legend>
@ -15,5 +15,5 @@
<input type="radio" id="yeasts" value="yeast" class="form-control" name="table" >
<label for="">Yeasts</label>
</div>
<button type="submit" class="btn btn-primary">Search</button>
</form>
Loading…
Cancel
Save