In laravel5.2, I used its login registration function to write a registration and login function, but the strange thing is that the registration page does not jump after submission. Why?
This is the code for my routes.php:
//认证路由
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
// 注册路由...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
This is the code of my register.php:
@extends('app')
@section('content')
<p class="col-md-4 col-md -offset-4">
{!! Form::open(['url'=>'/auth/register']) !!}
<p>
{!! Form::label('name','Name:') !!}
{!! Form::text('name',null,['class'=>'form-control']) !!}
</p>
<p>
{!! Form::label('email','Email:') !!}
{!! Form::email('email',null,['class'=>'form-control']) !!}
</p>
<p>
{!! Form::label('password','Password:') !!}
{!! Form::password('password',['class'=>'form-control']) !!}
</p>
<p>
{!! Form::label('password_confirmation','Password:') !!}
{!! Form::password('password_confirmation',['class'=>'form-control']) !!}
</p>
<br/>
{!! Form::submit('注册',['class'=>'btn btn-primary form-control']) !!}
{!! Form::close() !!}
</p>
@stop
According to the Internet, even if protected $redirectPath='specified page path' is not added to AuthController.php, you should jump to laravel's home page That's right. The problem is that it doesn't even jump, and the data is not received in the database. what's going on? Please help me take a look. I am a newcomer, thank you all in advance!
According to the method on the Internet, I added protected $redirectPath='/articles'; in AuthController.php and it did not jump to the articles page.
Add a 'method'=>'POST' to the form and try.
Excuse me, has it been solved?