P
P
photosho2018-06-04 18:54:32
Laravel
photosho, 2018-06-04 18:54:32

How to redirect in Laravel?

Didn't find an answer anywhere. How to redirect user to another address in Laravel 5? It is necessary to check whether the user is authorized each time they enter any page; if not, redirect to the "/auth" page.
I write the verification code in "/routes/web.php", before all the rules of the router - if the user is not authorized, then a redirect should occur. Or tell me how to do it right.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
roadtoexp, 2018-06-04
@photosho

https://laravel.com/docs/5.6/middleware

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question