首先,auth在5.1的版本情况下,官方是默认干掉了的。
在你正确注册路由之后,想要实现,你可以这样:
创建resources/views/auth/login.blade.php
:
<form method="POST" action="/auth/login">
{!! csrf_field() !!}
<div>
Email
<input type="email" name="email" value="{ old('email') }">
</div>
<div>
Password
<input type="password" name="password" id="password">
</div>
<div>
<input type="checkbox" name="remember"> Remember Me
</div>
<div>
<button type="submit">Login</button>
</div>
</form>
再创建resources/views/auth/register.blade.php
:
<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>
当然你可以使用Form包来生成表单,不过暂时这样写也可以。