*/ protected $fillable = [ 'corporation_type', 'corporation_name', 'options', 'user_id', ]; /** * Translatable fields * * @var array */ public $translatable = ['corporation_name']; /** * User, Document owner, Entrepreneur */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Formatted corporation type */ protected function formattedCorporationType(): Attribute { return Attribute::make( get: fn () => match ($this->corporation_type) { 'hk' => __('Private enterprise'), 'hj' => __('Partnership enterprise'), default => __('Entrepreneur') } ); } /** * Corporatoin name full name: "Web ulgam" HJ */ protected function formattedCorporationName(): Attribute { return Attribute::make( get: fn () => $this->corporation_name.' '.$this->formatted_corporation_type ); } }