How to use Laravel 9 Factory on package Models? #384
-
Hi and thanks for the all the work on this package! I have the following question: I saw in Laravel documentation that i have to add Is this a bad practice - should I do it any other way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi and thanks for using the package! Unfortunately, the package isn't currently set up for Laravel 8+ factories. This would be a great addition but I would want this to be included with some other updates and a major version bump. In the meantime, a workaround would be to create your own models and extend each one from the package. Remember to update the config file too. In your own models, you can now use the I hope that helps. |
Beta Was this translation helpful? Give feedback.
Hi and thanks for using the package!
Unfortunately, the package isn't currently set up for Laravel 8+ factories. This would be a great addition but I would want this to be included with some other updates and a major version bump.
In the meantime, a workaround would be to create your own models and extend each one from the package. Remember to update the config file too. In your own models, you can now use the
HasFactory
trait, then go ahead and make your factory classes.I hope that helps.