1 | <?php |
||
7 | class Experience extends Model |
||
8 | { |
||
9 | use Summable; |
||
10 | |||
11 | /** |
||
12 | * The attributes that are mass assignable. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $fillable = [ |
||
17 | 'user_id', |
||
18 | 'amount', |
||
19 | 'obtainable_id', |
||
20 | 'obtainable_type', |
||
21 | 'event_type', |
||
22 | 'data' |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * The attributes that should be cast to native types. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $casts = [ |
||
31 | 'data' => 'array' |
||
32 | ]; |
||
33 | |||
34 | /** |
||
35 | * The "booting" method of the model. |
||
36 | * |
||
37 | * @return void |
||
38 | */ |
||
39 | protected static function boot() |
||
50 | |||
51 | /** |
||
52 | * Return the sum cache configuration. |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | public function sumCaches() |
||
62 | |||
63 | /** |
||
64 | * Get the user that owns the log. |
||
65 | * |
||
66 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
67 | */ |
||
68 | public function user() |
||
72 | |||
73 | /** |
||
74 | * Get the obtainable relation. |
||
75 | * |
||
76 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
77 | */ |
||
78 | public function obtainable() |
||
82 | } |
||
83 |