'datetime', 'amount' => 'decimal:2', ]; // ✅ The user who approved the onboarding public function approver(): BelongsTo { return $this->belongsTo(User::class, 'approved_by'); } // Automatically hash password when setting it public function setPasswordAttribute($value): void { if (! empty($value)) { $this->attributes['password'] = bcrypt($value); } } // Scope to get only approved onboardings public function scopeApproved($query): mixed { return $query->where('status', 'approved'); } // Scope to get pending onboardings public function scopePending($query): mixed { return $query->where('status', 'pending'); } }