Support the ongoing development of Laravel.io →
posted 8 years ago
Eloquent
Last updated 2 years ago.
0

I think you might be creating an infinite loop here, as your static::find will create a new instance of model every time.

Why not generate the code (and do your checks) upon save, rather than on instantiation of the Model?

0

Yeah, the infinite loop propably causes the error.

Good idea to move the generation to the creating event.

Thanks a lot!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

TomHege tomhege Joined 6 Sep 2016

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.