postitief's avatar

Auth $loginPath as route

Hello,

Because I want to use a different route for login and redirect after login I put these in the AuthController.

protected $loginPath = "/login";
protected $redirectTo = "/webshop";

However, because I use named routes and default translations in the URL, I would like to put a route name in there. But how can I get that done?

0 likes
2 replies
Corez64's avatar
Corez64
Best Answer
Level 37

Best bet would be to put them in your constructor:

class AuthController extends Controller
{
    // ...

    public function __construct()
    {
        $this->loginPath = route('login');
        $this->redirectTo = route('webshop');
    }

    // ...
}
1 like

Please or to participate in this conversation.