Configuration
Naming convention
This library relies on some conventions.
Models
- Model names should always have the suffix "Model" in the file name, i.e., a user model would be named
UserModel. - Table names are always plural, i.e., the user model should have a
userstable. - Foreign keys in another table are always the sum of the name of a singular table and the primary key, i.e., if we have a table
userswith a primary keyid, the foreign key should look like this:user_id.
Entities
- Entities should have the same name as Models that use the entity, but without the “Model” suffix, i.e., the entity for
UserModelshould beUser.
Traits
This library relies on traits.
Models
- Every model should use
HasRelationstrait.
Entities
- Every entity should use
HasLazyRelationstrait - of course only if we want to use lazy loading.