Replies: 1 comment
-
This approach is good for a one-time start. Now imagine three cases:
If you need to create migrations from existing tables, it's easier to use the https://github.com/kitloong/laravel-migrations-generator package, for example. |
Beta Was this translation helpful? Give feedback.
-
Hi. i have an idea can we use php attributes for creating migration from model only?
Our model would looks like
and just call
php artisan generate:migration
and this would generate migration file withup
anddown
methods automaticallyyou can have an annotation when access the model and also create the model with migration inside of it. And it would be great if the
generate:migration
command would read the changes of the model then create migration file that will update the tableBeta Was this translation helpful? Give feedback.
All reactions