ClientStatus::class, ]; // ── Relationships ──────────────────────────────────────────── public function category(): BelongsTo { return $this->belongsTo(ClientCategory::class, 'category_id'); } public function events(): HasMany { return $this->hasMany(Event::class); } public function invoices(): HasMany { return $this->hasMany(Invoice::class); } public function contentBriefs(): HasMany { return $this->hasMany(ContentBrief::class); } public function mediaFiles(): HasMany { return $this->hasMany(MediaFile::class); } // ── Accessors ──────────────────────────────────────────────── public function getFullAddressAttribute(): string { $line3_parts = array_filter([$this->city, $this->state]); $country_part = array_filter([$this->postal_code, $this->country]); $country_str = implode(' - ', $country_part); if ($country_str) { $line3_parts[] = $country_str; } $line3 = implode(', ', $line3_parts); return collect([ $this->address_line1, $this->address_line2, $line3 ])->filter()->implode("\n"); } public function getInitialsAttribute(): string { $words = explode(' ', $this->name); return strtoupper( collect($words)->take(2)->map(fn ($w) => $w[0] ?? '')->implode('') ); } }