Open BenRutlandWeb opened 3 years ago
An issue with this is the developer may create an extending model which would then return the incorrect model. I.e.
Director
model extends User
model.
Movie::author()
method return an instance of User
not Director
.
The developer would be required to override the traits to change the subclass returned.
Is this solved by PHP8.1 #[\ReturnTypeWillChange]
?
Is your feature request related to a problem? Please describe. To get the post featured image requires adding boilerplate methods that could be used as a trait
Describe the solution you'd like A trait for things such as the post featured image and author.
HasFeaturedImage
Describe alternatives you've considered Adding the methods to the base class
Additional context Perhaps a trait for
HasAuthor
,HasFeaturedImage
,HasAttachment
etc.