Closed anhofmann closed 2 years ago
I get a the same error just using Laravel Jetstream and using teams.
Doing that includes a trait called HasTeams
where there is a belongsToMany
relation, which breaks everything :(
I had hoped that Laravel Jetstream was being used enough to not run into issues like these... from a year ago.
You are welcome to make a PR to fix this error. -- Krishan König
Website https://bitmate.dev/ | Github https://github.com/naoray | Twitter https://twitter.com/NaorayKroaths
I've been meaning to revisit this package. It's on the list. Unfortunately, it's not very high up. I'll try to do a live-stream and focus on the open issues soon.
Add
if ($relationObj instanceof BelongsToMany) {
return $relationObj->getForeignPivotKeyName();
}
to Naoray\EloquentModelAnalyzer\InteractsWithRelationMethods on line 104.
This worked for me
@tshafer @anhofmann Sorry for the delay. This should now be fixed in the latest release of eloquent-model-analyzer.
@jasonmccreary can you please update composer on this package to utilize the change on the underlying package?
@Naoray, sure, what's the new constraint?
v3.0.1
On Mon 22. Aug 2022 at 15:10, Jason McCreary @.***> wrote:
@Naoray https://github.com/Naoray, sure, what's the new constraint?
— Reply to this email directly, view it on GitHub https://github.com/laravel-shift/factory-generator/issues/13#issuecomment-1222338876, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNPA5D7VMIJNQFQBTYX4ZDV2N33HANCNFSM436ILU2Q . You are receiving this because you were mentioned.Message ID: @.***>
-- Krishan König
Website https://bitmate.dev/ | Github https://github.com/naoray | Twitter https://twitter.com/NaorayKroaths
This has been incremented on master. There are no tags for this package.
I was running
php artisan generate:factory
and it returned this exception:After some debugging I found out that this happens in my user model. Further investigations revealed that the trait
Rewardable
was the problem. This trait comes from this package: https://github.com/anhofmann/laravel-promocodes I forked this package, but I think it will also happen in the original package: https://github.com/zgabievi/laravel-promocodesI know that laravel-promocodes is pretty old, but it's working well in my laravel 8 app. Do you see a way to fix this? At this point I don't know if this is a bug in factory-generator or laravel-promocodes.