EntityType::class, ]; protected $appends = [ 'logo_url', ]; protected function logoUrl(): Attribute { return Attribute::get(static function (mixed $value, array $attributes): ?string { return $attributes['logo'] ? Storage::disk('public')->url($attributes['logo']) : null; }); } public function company(): BelongsTo { return $this->belongsTo(FilamentCompanies::companyModel(), 'company_id'); } public function country(): BelongsTo { return $this->belongsTo(Country::class, 'country', 'id'); } public function city(): BelongsTo { return $this->belongsTo(City::class, 'city_id', 'id'); } public function state(): BelongsTo { return $this->belongsTo(State::class, 'state_id', 'id'); } public function createdBy(): BelongsTo { return $this->belongsTo(FilamentCompanies::userModel(), 'created_by'); } public function updatedBy(): BelongsTo { return $this->belongsTo(FilamentCompanies::userModel(), 'updated_by'); } public function getCountryName(): string { return Country::findByIsoCode2($this->country)?->name ?? ''; } protected static function newFactory(): Factory { return CompanyProfileFactory::new(); } }