doukanhua0752
2015-10-06 05:24
浏览 63
已采纳

我们如何编辑Laravel Auth重定向网址?

In my project after authenticate the dashboard URL need to looks like "http://www.ct.dev/chistoper.martin_555/dashboard".

But now URL showing after authentication is "http://www.ct.dev/dashboard".

Please help me to edit url just like http://www.ct.dev/chistoper.martin_555/dashboard.

chistoper.martin_555 : I need to take this name from database.

AuthController.php

protected $redirectPath = '/dashboard';

routes.php

    Route::group(['middleware' => 'auth'], function () {
    Route::get('/dashboard', 'PublishprofileController@index');
});

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);
    }
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题