M
M
marq2022-02-25 21:16:07
Laravel
marq, 2022-02-25 21:16:07

Follow link only for authorized Laravel users?

there is such a task on laravel, there is a link (route), when an authorized user follows it, he goes through it without problems and the method works, but how to do this if the user is not authorized in the system, then when following this link, he first logs in , and then automatically redirected back to this link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
inFureal, 2022-02-25
@marq

Through middleware. Route::get(...)->middleware('auth');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question