Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
EventConfig
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 casts
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Models;
6
7use Engelsystem\Helpers\Carbon;
8use Illuminate\Database\Query\Builder as QueryBuilder;
9
10/**
11 * @property string $name
12 * @property string $value
13 * @property Carbon|null $created_at
14 * @property Carbon|null $updated_at
15 *
16 * @method static QueryBuilder|EventConfig[] whereName($value)
17 * @method static QueryBuilder|EventConfig[] whereValue($value)
18 * @method static QueryBuilder|EventConfig[] whereCreatedAt($value)
19 * @method static QueryBuilder|EventConfig[] whereUpdatedAt($value)
20 */
21class EventConfig extends BaseModel
22{
23    /** @var string The primary key for the model */
24    protected $primaryKey = 'name'; // phpcs:ignore
25
26    /** @var bool Indicates if the IDs are auto-incrementing */
27    public $incrementing = false; // phpcs:ignore
28
29    /** @var string Required because it is not event_configs */
30    protected $table = 'event_config'; // phpcs:ignore
31
32    /** @var array Values that are mass assignable */
33    protected $fillable = ['name', 'value']; // phpcs:ignore
34
35    /** @var bool It could be interesting to know when a value changed the last time */
36    public $timestamps = true; // phpcs:ignore
37
38    public function casts(): array
39    {
40        return [
41            'value' => 'array',
42        ];
43    }
44}