laravel php 跳转页面跳转页面,laravel 自动跳转页面

问题 一输入http://localhost/auth/login 或者 http://localhost/auth/register 就会自动跳转到http://localhost

Laravel版本信息

"name": "laravel/laravel",

"description": "The Laravel Framework.",

"keywords": ["framework", "laravel"],

"license": "MIT",

"type": "project",

"require": {

"php": ">=5.5.9",

"laravel/framework": "5.2.*",

"laravelcollective/html":"5.2.*"

},

http://localhost/auth/register 页面

{!! Form::open(["url"=>"/auth/register"]) !!}

{!! Form::label('name', 'Name:') !!}

{!! Form::text('name', null, ['class' => 'form-control']) !!}

{!! Form::label('email', 'Email:') !!}

{!! Form::email('email', null, ['class' => 'form-control']) !!}

{!! Form::label('password', 'Password:') !!}

{!! Form::password('password', ['class' => 'form-control']) !!}

{!! Form::label('password_confirmation', 'Password_confirmation:') !!}

{!! Form::password('password_confirmation', ['class' => 'form-control']) !!}

{!! Form::submit('注册', ['class' => 'btn btn-primary form-control']) !!}

{!! Form::close() !!}

http://localhost/auth/login 页面

{!! Form::open(["url"=>"/auth/login"]) !!}

{!! Form::label('email', 'Email:') !!}

{!! Form::email('email', null, ['class' => 'form-control']) !!}

{!! Form::label('password', 'Password:') !!}

{!! Form::password('password', ['class' => 'form-control']) !!}

{!! Form::submit('登录', ['class' => 'btn btn-primary form-control']) !!}

{!! Form::close() !!}

路由

Route::group([‘middleware’ => [‘web’]], function () {

Route::resource("articles", "ArticlesController");

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@logout');

Route::get('/', function () {

return view('welcome');

});

});

指定注册后跳转路径

protected $redirectPath ="/articles";

你可能感兴趣的:(laravel,php,跳转页面跳转页面)