Good day! Tell me who knows, I understand the registration in Laravel 5.1 in routes.php added

Route::get('auth/login', 'Auth\AuthController@getLogin'); Route::post('auth/login', 'Auth\AuthController@postLogin'); Route::get('auth/logout', 'Auth\AuthController@getLogout'); Route::get('auth/register', 'Auth\AuthController@getRegister'); Route::post('auth/register', 'Auth\AuthController@postRegister'); 

Views are both for login and for registration. Added admin (standard via seeds) logged in normally, registration problem, fill in the fields, but the user isn’t added, which I’m missing, but I don’t understand what, for registration I took from the documentation

 <form method="POST" action="/auth/register"> {!! csrf_field() !!} <div> Name <input type="text" name="name" value="{{ old('name') }}"> </div> <div> Email <input type="email" name="email" value="{{ old('email') }}"> </div> <div> Password <input type="password" name="password"> </div> <div> Confirm Password <input type="password" name="password_confirmation"> </div> <div> <button type="submit">Register</button> </div> </form> 

    1 answer 1

    I recommend using a turnkey solution from the Laravel Auth box. Alter under itself will not make you more work. Run the command in the console:

      php artisan make:auth 

    You can read more here: Authentication

    • This is for 5.3 and I have 5.1 and is also a box assembly, as I understand it, the same "Auth" controller - Route :: get ('auth / register', 'Auth \ AuthController @ getRegister') is used; Route :: post ('auth / register', 'Auth \ AuthController @ postRegister'); took from here laravel.ru/docs/v5/authentication - Yohan
    • well, otdebashte controller with registration and see the data from the form come or not - Evgeniy Mikhalichenko
    • In the controller with rega dd($request->all()); what is coming there? And what error occurs at all? - Alex_01
    • the problem is that there is no error, it simply does not add, and with dd ($ request-> all ()); writes array: 5 [▼ "_token" => "5egc8fH85N3J4hL06XEDhcHvGxoczTPYPa1pGz56" "name" => "user" "email" => "user@user.ru" "password" => "123" "password_confirmation" => "123" ] - Yohan
    • in the controller <br/> <code> trait RegistersUsers {public function postRegister (Request $ request) {$ validator = $ this-> validator ($ request-> all ()); if ($ validator-> fails ()) {$ this-> throwValidationException ($ request, $ validator); } Auth :: login ($ this-> create ($ request-> all ())); return redirect ($ this-> redirectPath ()); }} </ code> <br/> $ validator-> fails () works, but why I don’t understand yet - Yohan