#44 - vacation monthly usage

This commit is contained in:
Adrian Hopek
2022-03-24 09:39:12 +01:00
parent f106c159fa
commit 4c606daa6d
16 changed files with 555 additions and 1047 deletions

View File

@@ -100,6 +100,14 @@ class User extends Authenticatable
return $this->role === $role;
}
public function hasVacationLimit(YearPeriod $yearPeriod): bool
{
return $this->vacationLimits()
->where("year_period_id", $yearPeriod->id)
->whereNotNull("days")
->exists();
}
protected function getAvatarName(): string
{
return mb_substr($this->first_name, 0, 1) . mb_substr($this->last_name, 0, 1);