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?
Yeah, the infinite loop propably causes the error.
Good idea to move the generation to the creating event.
Thanks a lot!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community