Make model creation cli like Symfony's doctrine #54683
Unanswered
realazaber
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, when creating a new model via the CLI (php artisan make:model Flight), Laravel generates only the model file and, if specified, a migration file. However, the migration file includes only the default id field, requiring manual edits to define additional columns.
It would be a great improvement if Laravel could prompt for additional fields during model creation, similar to Symfony’s approach. The process could work like this:
Run: php artisan make:model Flight
Prompt: The CLI asks for additional fields (name, type, constraints, etc.)
Auto-Generation: The fields are automatically added to both the model and migration file
This would streamline development, reducing the need for manual migration edits and making the workflow more efficient. Symfony already implements a similar feature, as demonstrated in this video: https://youtu.be/IzJka_sDY6c?si=n9RYsokYDs0Wi-i1&t=135
Bringing this to Laravel would significantly enhance the developer experience. 🚀
Beta Was this translation helpful? Give feedback.
All reactions