*/ use HasFactory; use HasUuids; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'name' => 'string', 'archived_at' => 'datetime', ]; /** * @return BelongsTo */ public function organization(): BelongsTo { return $this->belongsTo(Organization::class, 'organization_id'); } /** * @return HasMany */ public function projects(): HasMany { return $this->hasMany(Project::class, 'client_id'); } /** * @return Attribute */ protected function isArchived(): Attribute { return Attribute::make( get: fn (mixed $value, array $attributes) => isset($attributes['archived_at']), ); } }