1 | <?php |
||
45 | class Addon extends Model |
||
46 | { |
||
47 | use ValidatingTrait; |
||
48 | use CacheableEloquent; |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | protected $fillable = [ |
||
54 | 'bookable_id', |
||
55 | 'bookable_type', |
||
56 | 'name', |
||
57 | 'title', |
||
58 | 'description', |
||
59 | 'base_cost', |
||
60 | 'base_cost_modifier', |
||
61 | 'unit_cost', |
||
62 | 'unit_cost_modifier', |
||
63 | ]; |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | protected $casts = [ |
||
69 | 'bookable_id' => 'integer', |
||
70 | 'bookable_type' => 'string', |
||
71 | 'name' => 'string', |
||
72 | 'base_cost' => 'float', |
||
73 | 'base_cost_modifier' => 'string', |
||
74 | 'unit_cost' => 'float', |
||
75 | 'unit_cost_modifier' => 'string', |
||
76 | ]; |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | protected $observables = [ |
||
82 | 'validating', |
||
83 | 'validated', |
||
84 | ]; |
||
85 | |||
86 | /** |
||
87 | * The default rules that the model will validate against. |
||
88 | * |
||
89 | * @var array |
||
90 | */ |
||
91 | protected $rules = []; |
||
92 | |||
93 | /** |
||
94 | * Whether the model should throw a |
||
95 | * ValidationException if it fails validation. |
||
96 | * |
||
97 | * @var bool |
||
98 | */ |
||
99 | protected $throwValidationExceptions = true; |
||
100 | |||
101 | /** |
||
102 | * Create a new Eloquent model instance. |
||
103 | * |
||
104 | * @param array $attributes |
||
105 | */ |
||
106 | public function __construct(array $attributes = []) |
||
123 | |||
124 | /** |
||
125 | * Get the owning resource model. |
||
126 | * |
||
127 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
128 | */ |
||
129 | public function bookable(): MorphTo |
||
133 | } |
||
134 |