sebastiaanluca / laravel-auto-morph-map

THIS PACKAGE HAS BEEN DEPRECATED — Automatically alias and map the polymorphic types of Eloquent models.
https://sebastiaanluca.com
MIT License
54 stars 9 forks source link

[Question] So this is simply helping me remove a couple lines of code by installing a package and running a command? #1

Closed OzanKurt closed 6 years ago

OzanKurt commented 6 years ago

So this is simply helping me remove a couple lines of code by installing a package and running a command?

sebastiaanluca commented 6 years ago

In medium to large apps, like the one I'm working on now, it allows me to get rid of 100s of lines of redundant and repetitive code. And that's another thing less to worry about too as the morph map is something you need to maintain if your app structure changes. It also provides a uniform way of mapping the polymorphic types so there are no discrepancies.

You can just install the package and it automatically maps all your models. The cache command is optional but advised in production environments to speed it up a bit. Package itself is optional too ;)

OzanKurt commented 6 years ago

Good!

You should definitely update your readme so that it explains what the package does just like you did here. Always good to go over examples . ;)

Cheers, Ozan Kurt

On 10 Aug 2018, at 08:27, Sebastiaan Luca notifications@github.com wrote:

In medium to large apps, like the one I'm working on now, it allows me to get rid of 100s of lines of redundant and repetitive code. And that's another thing less to worry about too as the morph map is something you need to maintain if your app structure changes. It also provides a uniform way of mapping the polymorphic types so there are no discrepancies.

You can just install the package and it automatically maps all your models. The cache command is optional but advised in production environments to speed it up a bit. Package itself is optional too ;)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

sebastiaanluca commented 6 years ago

Laravel auto morph map improves upon that by scanning all your Eloquent models, automatically aliasing them as uniform singular table names, and registering them as a polymorphic type. No more need for dozens of manual Relation::morphMap() calls to register model morph types!

Isn't the intro in the readme kind of the same? :p What would you add or change to make it more clear? Always love to hear feedback!