B
B
BarneyGumble2020-10-20 04:09:30
Laravel
BarneyGumble, 2020-10-20 04:09:30

How to change default login route in Laravel?

I don't have a separate login page on my site. My login is implemented through a modal html block that pops up when you click on the "Login in the header" link. This block contains the login form itself.

Also in web.php I have routes for my personal account in middleware:

Route::middleware('auth')->group(function () {
    Route::get('/account/edit', '[email protected]')->name('account.edit');
});


Those. if I immediately access /account/edit on the site, then by default I am redirected to /login

Is it possible to do something so that I am redirected to the main (or any other page) with a flash message through which I could cause the modal window to pop up with a login form?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2020-10-20
@delphinpro

See middleware app/Http/Middleware/Authenticate.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question