What you have is correct, but it will depend on where you're using this code. It will not work in some places as the route may not have been found or fired yet.
I'd be using it in my view. I want to use the same view in a couple of different routes, but need to change a couple of pieces of content depending on which one is being used.
Are you saying that either is correct?
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.