Added client to time entries

This commit is contained in:
Constantin Graf
2024-05-29 17:20:37 +02:00
committed by Constantin Graf
parent 2862033321
commit ec239f20f2
10 changed files with 372 additions and 7 deletions

View File

@@ -31,6 +31,8 @@ use Korridor\LaravelComputedAttributes\ComputedAttributes;
* @property-read Organization $organization
* @property string|null $project_id
* @property-read Project|null $project
* @property string|null $client_id
* @property-read Client|null $client
* @property string|null $task_id
* @property-read Task|null $task
*
@@ -124,4 +126,14 @@ class TimeEntry extends Model
{
return $this->belongsTo(Task::class, 'task_id');
}
/**
* This relation can be reconstructed via the task relation. It is only here for performance reasons.
*
* @return BelongsTo<Client, TimeEntry>
*/
public function client(): BelongsTo
{
return $this->belongsTo(Client::class, 'client_id');
}
}