Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.3 - changing auth view paths

Tags:

laravel-5.3

In my Laravel app I have different auth for administrators and users. So I have separete views as well. I have placed auth views folder inside admin folder, so that the view path to my admin auth is now admin.auth.login for example. Where can I change those paths so that I can use them for all the auth functions?

like image 251
Ludwig Avatar asked Sep 11 '25 17:09

Ludwig


1 Answers

If you take a look at your app\Http\Controllers\Auth\LoginController.php, you will see:

use AuthenticatesUsers;

It's a traits, you can find all the login related method over there in use Illuminate\Foundation\Auth\AuthenticatesUsers.php.

There's a method in the trait which show the view as below:

public function showLoginForm()
{
    return view('auth.login');
}

What you want to do is either:

  • Copy the traits out to your own one and modify the showLoginForm method.

or

  • Override the method showLoginForm in your LoginController.php. See this
like image 189
SteD Avatar answered Sep 15 '25 02:09

SteD