This commit is contained in:
Adrian Hopek
2022-02-08 13:46:52 +01:00
parent 75506dfb6d
commit 753d4bb296
5 changed files with 215 additions and 63 deletions

View File

@@ -28,6 +28,7 @@ use Toby\Domain\Enums\Role;
* @property Carbon $employment_date
* @property Collection $vacationLimits
* @property Collection $vacationRequests
* @property Collection $vacations
*/
class User extends Authenticatable
{
@@ -57,6 +58,11 @@ class User extends Authenticatable
return $this->hasMany(VacationRequest::class);
}
public function vacations(): HasMany
{
return $this->hasMany(Vacation::class);
}
public function scopeSearch(Builder $query, ?string $text): Builder
{
if ($text === null) {