You could also create a view partial. Then include that view wherever you need it.
In any case, regarding your question, you created a Helpers class. You need to then treat it like a class by having the proper namespace, importing it, etc.
I think I imported it correctly? at least the Helper class... seems like the error "Non-static method Illuminate\Routing\UrlGenerator::previous() should not be called statically, assuming $this from incompatible context" is from the way I handled the URL class, but I'm really not sure how to fix that front.
Maybe a view partial like you said would be easiest. :P Is it considered bad practice?
For this error: 'Non-static method Illuminate\Routing\UrlGenerator::previous()', it sounds like you are not correctly importing the URL facade.
You should be putting use URL;
at the top.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community