Support the ongoing development of →
Eloquent Architecture
Last updated 2 years ago.

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?

Last updated 8 years ago.

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.


I feel like an idiot now. Thanks!


Sign in to participate in this thread!


Your banner here too?

nchan0154 nchan0154 Joined 8 Oct 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.