D
D
Danila5342020-11-09 17:58:01
Laravel
Danila534, 2020-11-09 17:58:01

Routing Route [login] not defined?

Hello,

There was a problem...
According to my idea, everything should go like this: if a person is not registered, he gets a modal window with a message, but I end up with a Laravel error.

Route::prefix('user')->group(function () {
    Route::post('login', 'Auth\[email protected]');
    Route::get('logout', 'Auth\[email protected]')->name('logout');

    Route::post('register', 'Auth\[email protected]')->name('registration');

    Route::get('email/verify/{id}', 'Auth\[email protected]')->name('verification.verify');
    Route::get('email/resend', 'Auth\[email protected]')->name('verification.resend');

    Route::post('password/reset', 'Auth\[email protected]')->name('password.update');
});

if(!Auth::check())
            return back()->withErrors('Необходимо авторизоваться, перед открытием личного кабинета!');
5fa958c983ef8435944736.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
feycot, 2020-11-10
@feycot

The framework seems to be looking for a named route.
in line

Route::post('login', 'Auth\[email protected]');

Try giving the route a name.
Route::post('login', 'Auth\[email protected]')-name('login');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question