1 | <?php |
||
29 | class Task extends Model |
||
30 | { |
||
31 | /** |
||
32 | * The table associated with the model. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $table = 'tasks'; |
||
37 | |||
38 | /** |
||
39 | * Fields that are not mass assignable. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $guarded = ['id', 'created_at', 'updated_at']; |
||
44 | |||
45 | /** |
||
46 | * Cast values to correct type. |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $casts = [ |
||
51 | 'id' => 'integer', |
||
52 | 'user_id' => 'integer', |
||
53 | 'server_id' => 'integer', |
||
54 | 'queued' => 'boolean', |
||
55 | 'active' => 'boolean', |
||
56 | ]; |
||
57 | |||
58 | /** |
||
59 | * The attributes that should be mutated to dates. |
||
60 | * |
||
61 | * @var array |
||
62 | */ |
||
63 | protected $dates = ['last_run', 'next_run', 'created_at', 'updated_at']; |
||
64 | |||
65 | /** |
||
66 | * Gets the server associated with a task. |
||
67 | * |
||
68 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
69 | */ |
||
70 | public function server() |
||
74 | |||
75 | /** |
||
76 | * Gets the user associated with a task. |
||
77 | * |
||
78 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
79 | */ |
||
80 | public function user() |
||
84 | } |
||
85 |