如何解决路线 Laravel 未定义
我有这条路线:
Route::get('blog/search','web\BlogController@localSearch')->name($this->prefix.'blogSingle.localSearch');
这条路线在组内:
Route::group(['prefix' => $locale,'where' => ['locale' => '[a-zA-Z]{2}']],function(){
//Route::get('/','Web\HomeController@index')->name($this->prefix.'home.index');
Route::get('/','Web\ManagerController@index')->name($this->prefix.'home.index');
Route::get('about','Web\AboutController@index')->name($this->prefix.'about.index');
Route::get('contact','Web\ContactController@index')->name($this->prefix.'contact.index');
Route::get('help','Web\HelpController@index')->name($this->prefix.'help.index');
Route::get('local/{url}','Web\LocalController@index')->name($this->prefix.'local.index');
Route::get('privacy-policy','Web\PrivacyController@index')->name($this->prefix.'privacy.index');
Route::get('managers','Web\ManagerController@index')->name($this->prefix.'manager.index');
Route::get('blog','Web\BlogController@index')->name($this->prefix.'blog.index');
Route::get('search','Web\SearchController@index')->name($this->prefix.'search.index');
Route::get('suggest-local','Web\SuggestController@index')->name($this->prefix.'suggest.index');
Route::get('terms-conditions','Web\TermController@index')->name($this->prefix.'term.index');
Route::get('blog/{url}','web\BlogController@show')->name($this->prefix.'blogSingle.show');
Route::get('blog/likeit/{id}','web\BlogController@likeit')->name($this->prefix.'blogSingle.likeit');
Route::get('blog/search','web\BlogController@localSearch')->name($this->prefix.'blogSingle.localSearch');
Route::get('password/reset/{token}','Auth\ResetPasswordController@showResetForm')->name($this->prefix.'password.reset');
Route::get('email/verify/{id}','Auth\VerificationController@verify')->name($this->prefix.'verification.verify');
});
}
但我需要号召性用语:
<form action="{{ route('blog/search') }}" method="get" class="fl-wrap" id="searchRestaurant">
发送我的表格时,返回了这个:
Route [blog/search] not defined. (View: C:\wamp64\www\guiaPaladar\resources\views\layouts\right_sidebar_blog.blade.php)
刀片加载时出现此错误,所以我无能为力
我没有表现出我的错误,其他路线我可以以其他形式使用,例如 blog/likeit/{id}
我在 href 中使用以在帖子博客中添加...
我希望任何人都可以帮助我,拜托。对不起我的英语
谢谢
解决方法
如果您在使用blog/search
检查后确定路由php artisan route:list
已注册。但是,您的更改不会反映出来;您可能需要清除缓存。请使用以下命令:
php artisan route:clear
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。