add finish todos list

This commit is contained in:
Romulus21
2024-02-15 21:38:05 +01:00
parent 04b8f7566c
commit 583d128bf8
9 changed files with 90 additions and 10 deletions

View File

@@ -55,4 +55,11 @@ class User extends Authenticatable
{
return $this->hasMany(ToDo::class);
}
public function stopCurrentTimeTracker(): void
{
$this->currentTimeTracker()->update(['end_at' => now()]);
$this->time_tracker_id = null;
$this->save();
}
}