| 1 | <?php |
||
| 14 | class Task extends Model |
||
| 15 | { |
||
| 16 | use IsMeasurable, IsRecordable, HasStatus, HasPriority; |
||
| 17 | |||
| 18 | protected $table = 'tasks'; |
||
| 19 | |||
| 20 | public $primaryKey = 'id'; |
||
| 21 | |||
| 22 | public $guarded = ['id']; |
||
| 23 | |||
| 24 | public $timestamps = true; |
||
| 25 | |||
| 26 | protected $dates = [ |
||
| 27 | 'started_at', |
||
| 28 | 'delivered_at', |
||
| 29 | 'expected_at', |
||
| 30 | ]; |
||
| 31 | |||
| 32 | public function status() : HasOne |
||
| 36 | |||
| 37 | public function priority() : HasOne |
||
| 41 | |||
| 42 | public function projects() : MorphToMany |
||
| 46 | |||
| 47 | public function records() : MorphMany |
||
| 51 | } |
||
| 52 |