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 页面

<div class="col-md-4 col-md-offset-4">

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

<div class="form-group">

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

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

</div>

<div class="form-group">

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

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

</div>

<div class="form-group">

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

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

</div>

<div class="form-group">

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

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

</div>

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

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

</div>

http://localhost/auth/login 页面

<div class="col-md-4 col-md-offset-4">

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

<div class="form-group">

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

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

</div>

<div class="form-group">

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

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

</div>

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

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

</div>

路由

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";

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值