R
R
Roman2019-02-04 04:59:13
Laravel
Roman, 2019-02-04 04:59:13

How to competently reassign view for login in Laravel 5.7?

Hello!
The crux of the matter is this:
1. I want to change the design of forms related to Auth.
2. At the same time, I don’t want to edit existing views, but I want to put all new views in a separate folder, making something like a separate theme (as in WP).
3. But the fact is that in routes/web.php the routes are spelled out somehow like this "crowd"
Auth::routes();
and I don't want to redefine them separately either, since I have it inserted there and where to insert it into
Auth::routes(['verify' => true]);

Route::get('login', 'Auth\[email protected]')->name('login');

I have no idea yet (I'm quite a newbie).
Now I did this:
in the app\Http\Controllers\Auth\LoginController.php controller, I overridden the method:
public function showLoginForm()
    {
      return view('mytheme/login');
    }

and it now returns my view from the theme folder.
How correct from the point of view of Laravel's ideology is this done?
Is there a better solution to the issue?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2019-02-04
@procode

Overriding a method is enough

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question