Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 959 Bytes

models.md

File metadata and controls

42 lines (31 loc) · 959 Bytes

Models

ALWAYS STORE DATES IN DATABASE AS UTC!

It is Base Model class with overloaded converting functions. So extend your models from it.

Traits

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');

Table of contents