在验证仪表板URL后,我的项目需要看起来像“http://www.ct.dev/chistoper.martin_555/dashboard”。我们如何编辑Laravel Auth重定向url?
但是现在验证后的URL显示为“http://www.ct.dev/dashboard”。
请帮我编辑url,就像http://www.ct.dev/chistoper.martin_555/dashboard一样。
chistoper.martin_555:我需要从数据库中取这个名字。
AuthController.php
protected $redirectPath = '/dashboard';
routes.php文件
Route::group(['middleware' => 'auth'], function() {
Route::get('/dashboard', '[email protected]');
});
PublishprofileController.php
public function index()
{
session()->put('userID', Auth::user()->id);
$confirmDetails = User::select('confirmed_at')
->where('id', session()->get('userID'))
->first();
return view('test.frontend')->with('confirmTime', $confirmDetails->confirmed_at);
}
改变你的'$ redirectPath ='/ chistoper.martin_555/dashboard''并为它就像'Route :: get('/ chistoper.martin_555/dashboard','PublishprofileController @ index');' –