▲ | dsego 6 days ago | |
Not sure why Laravel decided to have that approach to models. In Django I can update the model properties and just generate a migration from that. I can always open the models.py file to see which fields a model class has. In Laravel I need to either look at the migration files or look inside the database table definition. And then also adding fields means writing the migration by hand I guess. There are other confusing things, like marking fields as fillable in the model, and if you fail to add your field in the fillable property, it won't be inserted into the database, and it took me awhile to figure out why my code wasn't working. Not sure what purpose it serves, I understand marking things as read only in serializers, but this is at the data layer, seems like a footgun. |