1 | <?php |
||
38 | class Availability extends Model implements AvailabilityContract |
||
39 | { |
||
40 | use ValidatingTrait; |
||
41 | use CacheableEloquent; |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | protected $fillable = [ |
||
47 | 'bookable_id', |
||
48 | 'bookable_type', |
||
49 | 'day', |
||
50 | 'starts_at', |
||
51 | 'ends_at', |
||
52 | 'price', |
||
53 | ]; |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | protected $casts = [ |
||
59 | 'bookable_id' => 'integer', |
||
60 | 'bookable_type' => 'string', |
||
61 | 'day' => 'string', |
||
62 | 'starts_at' => 'datetime', |
||
63 | 'ends_at' => 'datetime', |
||
64 | 'price' => 'float', |
||
65 | ]; |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | protected $observables = [ |
||
71 | 'validating', |
||
72 | 'validated', |
||
73 | ]; |
||
74 | |||
75 | /** |
||
76 | * The default rules that the model will validate against. |
||
77 | * |
||
78 | * @var array |
||
79 | */ |
||
80 | protected $rules = []; |
||
81 | |||
82 | /** |
||
83 | * Whether the model should throw a |
||
84 | * ValidationException if it fails validation. |
||
85 | * |
||
86 | * @var bool |
||
87 | */ |
||
88 | protected $throwValidationExceptions = true; |
||
89 | |||
90 | /** |
||
91 | * Create a new Eloquent model instance. |
||
92 | * |
||
93 | * @param array $attributes |
||
94 | */ |
||
95 | public function __construct(array $attributes = []) |
||
109 | |||
110 | /** |
||
111 | * Get the owning model. |
||
112 | * |
||
113 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
114 | */ |
||
115 | public function bookable(): MorphTo |
||
119 | } |
||
120 |