Support the ongoing development of Laravel.io →
Eloquent Architecture
Last updated 1 year ago.
0

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.

0

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.
0

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.

0

I feel like an idiot now. Thanks!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

nchan0154 nchan0154 Joined 8 Oct 2015

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.