Answer the question
In order to leave comments, you need to log in
Is it possible to create a controller that will run with any route?
You need to run code that, if the user is not authorized, creates a session with a selection from the database.
I thought that it would be convenient to do this in a "general" controller, since sessions cannot be used in AppServiceProvider.
I did it through the facade, but spreading the same code into two dozen controllers - thank you.
And if something changes, then deleting this code is some kind of hell.
Answer the question
In order to leave comments, you need to log in
You need to run code that, if the user is not authorized, creates a session with a selection from the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question