ALWAYS STORE DATES IN DATABASE AS UTC!
It is Base Model class with overloaded converting functions. So extend your models from it.
Additionally Base Model class use some helpful traits.
- ModelLabels. This trait gives labels to model attributes.
// Client model
/**
* {@inheritDoc}
*/
public static function attributeLabels(): array
{
return [
'name' => trans('Client\'s Name'),
'created_at' => trans('Creation Date'),
'updated_at' => trans('Modification Date'),
];
}
$client_name_label = Client::getAttributeLabel('name');
- ModelScopes. This trait contains query scopes.