2017-04-24 183 views
0

當用戶重置密碼時,它們會發送到我的儀表板。我需要從我讀過,我只是在我的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]'); 
} 

回答

1
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'

我將需要更多的信息,比如如何定義路線來檢測問題,如果尚未解決