在Laravel 5.5项目中,我在从密码重置表单提交电子邮件ID后收到以下内容:
但是,在浏览器中粘贴上述URL时,“laravel log'说" local.INFO:无法找到页面"。我看到显示的是电子邮件提交表单而不是密码&确认密码表格。
我的路线定义如下:
Route::group(['prefix' => 'administrator'], function() {
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.email');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset.token');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.reset');
});
我的ResetPasswordController.php如下;
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Model\User;
use Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Facades\Redirect;
use Hash;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/administrator/password/reset';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* METHOD TO RESET ADMIN PASSWORD
*/
}
答案 0 :(得分:0)
你必须按照调整路线。
Route::group(['prefix' => 'administrator'], function() {
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset.token');
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.email');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.reset');
});
将password/reset/{token}
移到password/reset
希望这有帮助。