I am using A Search Bar Form which searches in a database of +-175.000 Models. I've installed Scout accordingly to the documentation and imported all the records using scout:import
.
Now, I've setup a function in my Controller to do the search and return all Records, but the records are always empty, regardless for what I search.
web.php:
Route::post('/act/search', ['uses' => 'ActController@searchAct', 'as' =>'searchAct']);
ActController@searchAct:
public function searchAct(Request $request)
{
$actes = Act::search($request->search)->paginate(100);
return view('act')->with('actes', $actes);
}
The form:
<form class="navbar-form navbar-left" action="{{ route('searchAct') }}" method="post">
{{ csrf_field() }}
<div class="form-group">
<input type="text" name="search" id="search" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Search</button>
</form>
As far as I see this should work but dd($actes)
say that the collection is empty. I've included the use Searchable;
Entrait in my Model. Scout index the records fine: All [App\Act]
records have been imported.