#44 - vacation summary of all employees (#92)

* #44 - ui for summary

* #44 - vacation monthly usage

* #44 - fix

* #44 - fix

Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
This commit is contained in:
Adrian Hopek
2022-03-24 10:33:34 +01:00
committed by GitHub
parent dcda8c6255
commit 957b07b3eb
18 changed files with 710 additions and 1019 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);