Laravel 5.4 RedirectTo无法在ResetPasswordController中工作
问题描述:
当用户重置密码时,它们会发送到我的仪表板。我需要从我读过,我只是在我的ResetPasswordController添加RedirectTo其他地方,并引导他们,但这样做没有效果:Laravel 5.4 RedirectTo无法在ResetPasswordController中工作
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
use ResetsPasswords;
protected $redirectTo = '/checkcart';
public function __construct()
{
$this->middleware('guest');
}
}
UPDATE提供在其上缺省auth航路信息
支票车路线:
Route::get('checkcart', '[email protected]');
密码重设路线由
Route::auth();
012确定
具有默认:
public function auth()
{
// Authentication Routes...
$this->get('login', 'Auth\[email protected]')->name('login');
$this->post('login', 'Auth\[email protected]');
$this->post('logout', 'Auth\[email protected]')->name('logout');
// Registration Routes...
$this->get('register', 'Auth\[email protected]')->name('register');
$this->post('register', 'Auth\[email protected]');
// Password Reset Routes...
$this->get('password/reset', 'Auth\[email protected]')->name('password.request');
$this->post('password/email', 'Auth\[email protected]')->name('password.email');
$this->get('password/reset/{token}', 'Auth\[email protected]')->name('password.reset');
$this->post('password/reset', 'Auth\[email protected]');
}
答
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}
这是默认的代码,你只需要改变 “$ redirectTo = '/家' 到你想要的路线 - ” $ redirectTo = '/ checkcart'
我将需要更多的信息,比如如何定义路线来检测问题,如果尚未解决