'int', 'bonus' => 'int', 'deduction' => 'int', 'total_salary' => 'int', 'is_paid' => IsPaid::class, ]; } #[Scope] public function paid(Builder $query): void { $query->where('is_paid', IsPaid::PAID->value); } #[Scope] public function notPaid(Builder $query): void { $query->where('is_paid', IsPaid::NOT_PAID->value); } #[Scope] public function forCurrentUser(Builder $query): void { $user = auth()->user(); if ($user && ! $user->hasRole(['Owner', 'Developer'])) { $query->where('user_id', $user->id); } } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function adjustments(): HasMany { return $this->hasMany(PayrollAdjustment::class); } }