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?
Asked
Active
Viewed 2,615 times
4

Ludwig
- 1,401
- 13
- 62
- 125
1 Answers
6
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 yourLoginController.php
. See this
-
Yes, I had to change for each auth function login, register, forgot/reset password new view paths with overwriting the functions in my controller. I just hoped that there would be a shorter way of doing that. – Ludwig Oct 19 '16 at 07:47