laravel 抱歉,找不到您要找的页面。RouteCollection.php 第 179 行中的 1/1 NotFoundHttpException:
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43494813/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sorry, the page you are looking for could not be found. 1/1 NotFoundHttpException in RouteCollection.php line 179:
提问by Ademaintain
Hello please i am a new user of larvel, i have such error while trying to create a link to register, it throws the error above
你好,我是 larvel 的新用户,我在尝试创建注册链接时遇到这样的错误,它抛出了上面的错误
my controller is
我的控制器是
Route::group(['prefix'=>'auth'], function(){
Route::get('register', [
'as' => 'get_register',
'uses' => 'Auth/RegisterController@RegistersUsers'
]);
Route::post('register', [
'as' => 'post_register',
'uses' => 'Auth/RegisterController@register'
]);
});
and my links is
我的链接是
<a href="{{ url('register') }}">Register</a>
i have created a register.blade.php inside auth folder in view. Please help
我在视图中创建了一个 register.blade.php 在 auth 文件夹中。请帮忙
回答by Kyllian Vinkler
You prefixed your urls by auth
. In your link, try to use this syntax :
您在网址前加上auth
. 在您的链接中,尝试使用以下语法:
<a href="{{ url('auth/register') }}">Register</a>
回答by Meera Tank
You can try like
你可以试试像
<a href="{{ route('name-of-route') }}">Register</a>
In Your case
在你的情况下
<a href="{{ route('get_register') }}">Register</a>
回答by AddWeb Solution Pvt Ltd
I think your code need to update like:
我认为您的代码需要更新如下:
Your controller/route
您的控制器/路由
Route::group(['prefix'=>'auth'], function(){
Route::get('register', 'RegisterController@RegistersUsers')->name('get_register');
Route::post('register', 'RegisterController@register')->name('post_register');
});
and your links is:
你的链接是:
<a href="{{ route('get_register') }}">Register</a>
<a href="{{ route('get_register') }}">Register</a>
Hope this work for you!
希望这对你有用!