Read from the Porto SAP Documentation (#Models).
- All Models MUST extend from
- If the name of a model differs from the Container name you have to set the
$containerattribute in the repository - more details.
Notice the Demo Model has a relationship with User Model, which lives in another Container.
The casts attribute can be used to parse any of the model's attributes to a specific type. In the code sample below we can cast
More information about the applicable cast-types can be found in the laravel eloquent-mutators documentation.
You can place any dates inside the
$dates to parse those automatically.