MasoniteFramework / masonite4

Temporary Repository for a Masonite Rewrite for Masonite 4
14 stars 3 forks source link

Add ORM commands #219

Closed girardinsamuel closed 2 years ago

girardinsamuel commented 2 years ago

Fixes #214 For now I added all commands available inside ORMProvider from orm package and then I swapped the MakeModelCommand with an internal one. I guess we should do it for some other commands so that models location and migrations location are correctly configured without to pass --models or --directory option each time.

To achieve this I added a way to swap commands in the command capsule by another one at the same key, and then I registered an "Internal ORM Provider" to make the swapping.

Finally end users just see the ORMProvider coming from the masonite package.

What's left to do : duplicate other commands that require some location already defined in Masonite -> actually all commands need this.

girardinsamuel commented 2 years ago

It looks really clean to me now ! @josephmancuso Ready for review ! And the cookie-cutter is updated here : https://github.com/MasoniteFramework/cookie-cutter/pull/20