-
Notifications
You must be signed in to change notification settings - Fork 63
Make some models macroable #107
Comments
Hi @larsjanssen6 , I'm ok with making things macroable. Another way would be to make classes swappable by setting the class in the config, but that would take a lot of work. |
Looks like this is not possible on models yet in Laravel: |
For now I have overwritten the |
Yeah that was what I was afraid of with the macroable trait... Just curious, how did you overwrite it? |
@sandervanhooft I made a custom class and extend the |
Good to know. Thanks! |
I recently made a little package which allows to add macros to Eloquent models: https://github.com/javoscript/laravel-macroable-models Let me know if you try it out and if it is of any use! =) |
Hi,
Would it be an idea to make some models
macroable
.For example I need to add an
address
to theorder
model. If theorder
model was
macroable
I could add the relation like this:Boot method in serviceprovider:
Would you accept a PR for this or is there a better way?
Thanks!
The text was updated successfully, but these errors were encountered: