*/ protected $fillable = [ 'call_reason_type_id', 'label', 'label_translation_key', ]; /** * Get the call reason type associated with call reason. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\CallReasonType, $this> */ public function callReasonType(): BelongsTo { return $this->belongsTo(CallReasonType::class); } /** * Get the name of the reverse relationship attribute. * Call reasons entries have a default name that can be translated. * Howerer, if a name is set, it will be used instead of the default. * * @return Attribute */ protected function label(): Attribute { return Attribute::make( get: function (?string $value, array $attributes) { if ($value === null) { return __($attributes['label_translation_key']); } return $value; }, set: fn ($value) => $value, ); } }