Class attribute for overriding factory class #54054
Unanswered
christopherarter
asked this question in
Ideas
Replies: 2 comments
-
Hi. Attributes are read/processed/compiled at run time not at compile time in php. I know Laravel embraced them because octane can handle them fast. But they don't have ctrl click and so on in IDE. This is my opinion about them: #52193 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Give people choices—go for it 👍🏻 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey all!
I had an idea for a PR and curious if there's any interest / appetite for it. It's very common for me to have models in custom namespaces, e.g.
App\SomeFeatureDomain\Models\SomeModel
and in that scenario, I have to explicitly write anewFactory()
static method on each model. This is a PR that would introduce an Eloquent attribute as a shorthand.I have this working well on a local branch and curious if it's worth finishing up with tests & raising a PR?
Beta Was this translation helpful? Give feedback.
All reactions