-
Notifications
You must be signed in to change notification settings - Fork 6
Comparison: Moldable ORM vs Laravel Eloquent
Laravel Eloquent use a table called 'migrations' to store the history of continuous integration DB evolution, this table represents a part of the framework and not a part of the application. Moldable ORM make a comparison between actual state and requested new schema like a DIFF tool, then move the database to change itself.
Laravel Eloquent for a correct usage needs to understand and apply Collections convention and factorizations to bulk for one record of a list o get one field of a record or use horrible 'pluck'. Moldable ORM uses an array as pseudo-query and extends it in an intuitive way.
// Eloquent
$myField = Model::where('name', 'John Doe')->first()->my_field;
// Moldable
$myField = Model::first(['name' => 'John Doe'], 'my_field');
Laravel Eloquent model and related database table can be dissonant because we need to declare migrations and model fields in two different points of the codebase. Moldable ORM guaranty everytime that database fit perfectly the model settings, any new field, any new type to hold data or relation is in a real-time aligned by Moldable ORM.