You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After enabling the new LARAVEL_FACTORIES set, I had to revert 120 changed models in a project where the HasFactory trait was added when no factory class actually exists. I would argue that in its current state, AddHasFactoryToModelsRector doesn't belong in this set as it's not reasonable to assume every app has a factory for every single model in their application.
Ideally, the rector would check if the factory exists first prior to adding the HasFactory trait. It would be nice if it added the appropriate @use docblock referencing the factory class as well. I don't know if this is currently feasible, though.
Just my two cents. Skipping that rule is an easy enough solution as well.