Property::casts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Siak\Tontine\Model;
4
5
class Property extends Base
6
{
7
    /**
8
     * Indicates if the model should be timestamped.
9
     *
10
     * @var bool
11
     */
12
    public $timestamps = false;
13
14
    /**
15
     * The attributes that are mass assignable.
16
     *
17
     * @var array
18
     */
19
    protected $fillable = [
20
        'content',
21
    ];
22
23
    /**
24
     * The model's default values for attributes.
25
     *
26
     * @var array
27
     */
28
    protected $attributes = [
29
        'content' => '{}',
30
    ];
31
32
    /**
33
     * Get the attributes that should be cast.
34
     *
35
     * @return array<string, string>
36
     */
37
    protected function casts(): array
38
    {
39
        return [
40
            'content' => 'array',
41
        ];
42
    }
43
44
    /**
45
     * Get the parent owner model.
46
     */
47
    public function owner()
48
    {
49
        return $this->morphTo();
50
    }
51
}
52