*/ use HasFactory, Notifiable, HasRoles; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } public function clientProjects() { return $this->hasMany(Project::class, 'client_id'); } public function techLeadProjects() { return $this->hasMany(Project::class, 'tech_lead_id'); } public function assignedTasks() { return $this->hasMany(ProjectTask::class, 'developer_id'); } public function attendances() { return $this->hasMany(Attendance::class); } public function leads() { return $this->hasMany(Lead::class, 'sales_person_id'); } public function projectCredentials() { return $this->belongsToMany(ProjectCredential::class, 'credential_user')->withTimestamps(); } public function getProfilePhotoUrlAttribute() { return $this->profile_photo_path ? \Illuminate\Support\Facades\Storage::url($this->profile_photo_path) : 'https://ui-avatars.com/api/?name=' . urlencode($this->name) . '&color=FF6D28&background=0B2447'; } }