The error shows that you are using a route with a name that does not exists in some view. So try searching your project for usage of 'admin.search_case' and rename that with 'admin.search_cases' as your named route.
Jul 29, 2019
8
Level 1
Route not defined?
Hello.
I'm trying to make a search on the same page in my admin dashboard.
here's what I did in my controller:
public function search(){
$q = Input::get ( 'q' );
if($q != ""){
$case = Case::where ( 'donation_title', 'LIKE', '%' . $q . '%' )->orWhere ( 'donation_story', 'LIKE', '%' . $q . '%' )->paginate (5)->setPath ( '' );
$pagination = $case->appends ( array (
'q' => Input::get ( 'q' )
) );
if (count ( $case ) > 0)
return view ( 'admin.cases.index' )->withDetails ( $case )->withQuery ( $q );
}
return view ( 'admin.cases.index' )->withMessage ( 'No Details found. Try to search again !' );
}
my route :
Route::post('/search/case','CasesController@search')->name('admin.search_cases');
my from :
<div class="container">
<form action="{{route('admin.search_cases')}}" method="POST" role="search">
{{ csrf_field() }}
<div class="input-group">
<input type="text" class="form-control" name="q"
placeholder="Search cases"> <span class="input-group-btn">
<button type="submit" class="btn btn-default">
<span class="la la-search"></span>
</button>
</span>
</div>
</form>
</div>
Im getting :
Route [admin.search_case] not defined.
I checked the route list PHP php artisan route:list and I cant see it
PS: I tried to clear the cache and config nothing changed
any idea whats going on here?
Level 1
the problem is gone once I updated the app using composer update
Please or to participate in this conversation.