*/ use HasFactory, Notifiable, HasRoles, SoftDeletes, LogsActivity, HasApiTokens; public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logFillable() ->logOnlyDirty() ->dontSubmitEmptyLogs(); } /** * PHP 8.4 Property Hooks (Polyfill for PHP 8.3 environment) */ public function getFullName(): string { return "{$this->first_name} {$this->last_name}"; } public function isActive(): bool { return $this->status === 'active' && !$this->deleted_at; } /** * PHP 8.4 Asymmetric Visibility (Polyfill) */ protected ?string $avatarUrl = null; public function getAvatarUrl(): ?string { return $this->avatarUrl; } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'meta' => 'array', 'status' => 'string', ]; } /** * Sync avatarUrl with avatar_url attribute. */ public function setAvatar(string $path): void { $this->avatar_url = $path; $this->avatarUrl = \Illuminate\Support\Facades\Storage::url($path); } }