1 | <?php |
||
12 | class Platform extends Model |
||
13 | { |
||
14 | use ValidatingTrait; |
||
15 | use CacheableEloquent; |
||
16 | |||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | protected $fillable = [ |
||
21 | 'family', |
||
22 | 'version', |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | protected $casts = [ |
||
29 | 'family' => 'string', |
||
30 | 'version' => 'string', |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public $timestamps = false; |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | protected $observables = [ |
||
42 | 'validating', |
||
43 | 'validated', |
||
44 | ]; |
||
45 | |||
46 | /** |
||
47 | * The default rules that the model will validate against. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $rules = [ |
||
52 | 'family' => 'required|string', |
||
53 | 'version' => 'nullable|string', |
||
54 | ]; |
||
55 | |||
56 | /** |
||
57 | * Whether the model should throw a |
||
58 | * ValidationException if it fails validation. |
||
59 | * |
||
60 | * @var bool |
||
61 | */ |
||
62 | protected $throwValidationExceptions = true; |
||
63 | |||
64 | /** |
||
65 | * Create a new Eloquent model instance. |
||
66 | * |
||
67 | * @param array $attributes |
||
68 | */ |
||
69 | public function __construct(array $attributes = []) |
||
75 | |||
76 | /** |
||
77 | * The platform may have many requests. |
||
78 | * |
||
79 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
80 | */ |
||
81 | public function requests(): HasMany |
||
85 | } |
||
86 |