Replies: 3 comments
-
This is a nice idea but very difficult to implement via Attributes (like in symfony) and cover all supported db language possibilities... Symfony creates raw query migrations which I prefer to avoid in favor of laravel's migrations. ex. 'date_column', // date default null |
Beta Was this translation helpful? Give feedback.
-
Until this auto migration is done, we introduced autocomplete for model attributes: #51783 |
Beta Was this translation helpful? Give feedback.
-
Laravel uses the Active Record pattern, this means that the model itself is not a DTO, instead it uses accessor methods to dynamically get the rows from the database. The model itself doesn't care about any column existing in the database except the PK which is given as a string. You can try: https://laraveldoctrine.org/ this might suite you more, it has everything you want. |
Beta Was this translation helpful? Give feedback.
-
Looking forward to having a feature in Laravel framework called Dynamic Model Migration.
Migration should work based on model public attributes, e.g.,
id
,email
,role
, etc. Whenever I add or change the model attributes, I should be able to create a new migration file that includes the updated model attributes along with their types. This would simplify development by eliminating the need to manually check database tables for attribute names and types, and it would also enhance IDE support for autocompletion when accessing properties.This idea is inspired by ASP.NET Core 6 - Entity Framework (ORM).
For more information, refer to the ASP.NET Core documentation on migrations.
Beta Was this translation helpful? Give feedback.
All reactions