Model's morph mapped names using PHP8 attributes #41812
Unanswered
walirazzaq
asked this question in
Ideas
Replies: 0 comments
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.
-
Currently to define
morphMap
for models we haveRelation::morphMap
method which we normally call fromServiceProviders
.I was wondering if we can use PHP8 attributes on model class itself to define morph mapped name
We can further introduce artisan commands to generate and cache morphMap for larger applications having quite a few models
Beta Was this translation helpful? Give feedback.
All reactions