Answer the question
In order to leave comments, you need to log in
Laravel: where to do common calculations for all routes?
Noob question, sorry.
Let's take a blog, in the left column there is a list of categories, it is the same for all blog pages. I am far from thinking that in each route function I need to read this list into the $categories variable in order to use it later in the template.
Middleware? But judging by the examples, this is for filtering requests.
So where should this be done ideologically correctly?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question