28 lines
518 B
PHP
28 lines
518 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TimeTracker extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'start_at',
|
|
'end_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'start_at' => 'datetime',
|
|
'end_at' => 'datetime',
|
|
];
|
|
|
|
public function toDo(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ToDo::class, 'to_do_id');
|
|
}
|
|
}
|