*/ use HasFactory, Notifiable, HasRoles; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'title', 'first_name', 'last_name', 'email', 'password', 'status', 'valid_from', 'valid_until', 'company_id', 'phone', 'address', 'notes', ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'password', 'remember_token', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'valid_from' => 'date', 'valid_until' => 'date', ]; } public function company() { return $this->belongsTo(\App\Models\Company::class); } // Many-to-many with projects public function projects() { return $this->belongsToMany(Project::class)->withPivot('role_in_project')->withTimestamps(); } // Progress updates made public function progressUpdates() { return $this->hasMany(ProgressUpdate::class); } }