我正在尝试使用 Laravel 提供的 Auth 注册用户,但我不能。另外,我在同一个视图(索引)中进行登录和注册。通过一个按钮,我可以将视图更改为登录或注册。所有这一切都发生在sidenav
这是我的路线:
//Auth routes
Route::get('/home', 'HomeController@home')->name('home');
Route::view('/', 'layouts/index');
Route::view('/profile', 'layouts/profile');
Route::get('/welcome', 'UserController@getUsers');
// Authentication Routes
Route::post('/', 'Auth\LoginController@login');
Route::post('/', 'Auth\LoginController@logout')->name('logout');
// Registration Routes...
Route::post('/', 'Auth\RegisterController@create')->name('register');
Run Code Online (Sandbox Code Playgroud)
这是注册视图:
<button type="button" id="registGoBackButton" class="btn accessButtons goBackButton" style="display:block;"><i class="fas fa-chevron-left"></i></button>
<div class="row user-view">
<blockquote style="margin-top:0px; margin-bottom:30px;"><h3 style="margin-top:0px; margin-bottom:30px;">Register</h3></blockquote>
<form class="" action="{{ route('register') }}" method="POST">
@csrf
<div class="input-field col s6">
<input name="name" id="registName" type="text" class="validate" required value="">
<label for="name">{{ __('Name') }}</label>
</div>
<div class="input-field col s6">
<input name="username" id="registUsername" type="text" class="validate" required value="{{ …Run Code Online (Sandbox Code Playgroud) php registration user-registration laravel laravel-authentication