resources/views/layouts/app.blade.php
<meta name="csrf-token" content="{{ csrf_token() }}">
/password/reset
# resources/views/auth/passwords/email.blade.php
<form role="form" method="POST" action="{{ route('password.email') }}">
{{ csrf_field() }}
<input id="email" type="email" name="email" value="{{ old('email') }}" required>
<button type="submit">
Send Reset Link
</button>
</form>
发布到/password/reset
后,我遇到了TokenMismatchException
错误:
路线:
$ php artisan route:list | grep password
| account.local.mysite.com | POST | password/email | password.email | App\Http\Controllers\Auth\ForgotPasswordController@sendResetLinkEmail | web,ip,guest |
| account.local.mysite.com | POST | password/reset | | App\Http\Controllers\Auth\ResetPasswordController@reset | web,ip,guest |
| account.local.mysite.com | GET|HEAD | password/reset | password.request | App\Http\Controllers\Auth\ForgotPasswordController@showLinkRequestForm | web,ip,guest |
| account.local.mysite.com | GET|HEAD | password/reset/{token} | password.reset | App\Http\Controllers\Auth\ResetPasswordController@showResetForm | web,ip,guest
.env
APP_ENV=local
APP_KEY=base64:asffwl8j+2xW+LOzTIPcsO0XsMdwjeijKo6ktLyrpI=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_SCHEME=http
添加了前5行的.env
文件。它包含APP_KEY
,但是为什么在php artisan tinker
下找不到?
怎么了?
答案 0 :(得分:0)
清除这些选项并清除浏览器缓存后,它即可工作。
php artisan config:clear
php artisan clear
php artisan cache:clear
php artisan auth:clear-resets
php artisan view:clear