Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| TimeTracker | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| user | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| toDo | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 6 | use Illuminate\Database\Eloquent\Model; |
| 7 | use Illuminate\Database\Eloquent\Relations\BelongsTo; |
| 8 | |
| 9 | class TimeTracker extends Model |
| 10 | { |
| 11 | use HasFactory; |
| 12 | |
| 13 | protected $fillable = [ |
| 14 | 'start_at', |
| 15 | 'end_at', |
| 16 | ]; |
| 17 | |
| 18 | protected $casts = [ |
| 19 | 'start_at' => 'datetime', |
| 20 | 'end_at' => 'datetime', |
| 21 | ]; |
| 22 | |
| 23 | public function user(): BelongsTo |
| 24 | { |
| 25 | return $this->belongsTo(User::class); |
| 26 | } |
| 27 | |
| 28 | public function toDo(): BelongsTo |
| 29 | { |
| 30 | return $this->belongsTo(ToDo::class); |
| 31 | } |
| 32 | } |