sohelamin / laravel-starter

Laravel Starter Project
19 stars 15 forks source link

Change login redirect to Admin #7

Closed randycasburn closed 7 years ago

randycasburn commented 7 years ago

Please consider changing:

protected $redirectTo = '/home'; to protected $redirectTo = '/admin'; in app/Http/Controllers/Auth/LoginController.php

Thanks.

sohelamin commented 7 years ago

Hi @randycasburn

Did you see?

    protected function authenticated(Request $request, $user)
    {
        if ($user->hasRole('admin')) {
            return redirect('/admin');
        }

        return redirect('home');
    }

If the user has admin role then it will be automatically redirected to admin route.

randycasburn commented 7 years ago

I suppose I missed that work flow. I'll close this.