1 | <?php |
||
12 | abstract class BookableAddon extends Model |
||
13 | { |
||
14 | use ValidatingTrait; |
||
15 | use CacheableEloquent; |
||
16 | |||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | protected $fillable = [ |
||
21 | 'bookable_id', |
||
22 | 'bookable_type', |
||
23 | 'slug', |
||
24 | 'name', |
||
25 | 'description', |
||
26 | 'base_cost', |
||
27 | 'base_cost_modifier', |
||
28 | 'unit_cost', |
||
29 | 'unit_cost_modifier', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | protected $casts = [ |
||
36 | 'bookable_id' => 'integer', |
||
37 | 'bookable_type' => 'string', |
||
38 | 'slug' => 'string', |
||
39 | 'base_cost' => 'float', |
||
40 | 'base_cost_modifier' => 'string', |
||
41 | 'unit_cost' => 'float', |
||
42 | 'unit_cost_modifier' => 'string', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | protected $observables = [ |
||
49 | 'validating', |
||
50 | 'validated', |
||
51 | ]; |
||
52 | |||
53 | /** |
||
54 | * The default rules that the model will validate against. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | protected $rules = []; |
||
59 | |||
60 | /** |
||
61 | * Whether the model should throw a |
||
62 | * ValidationException if it fails validation. |
||
63 | * |
||
64 | * @var bool |
||
65 | */ |
||
66 | protected $throwValidationExceptions = true; |
||
67 | |||
68 | /** |
||
69 | * Create a new Eloquent model instance. |
||
70 | * |
||
71 | * @param array $attributes |
||
72 | */ |
||
73 | public function __construct(array $attributes = []) |
||
90 | |||
91 | /** |
||
92 | * Get the owning resource model. |
||
93 | * |
||
94 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
95 | */ |
||
96 | public function bookable(): MorphTo |
||
100 | } |
||
101 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.