{$attribute} || ($attributes->has(':' . $attribute) && $attributes->get(':' . $attribute)); } public function asAlpineString(ComponentAttributeBag $attributes, string $tagName): string { $rawTag = ':' . $tagName; if ($attributes->has($rawTag) && $attributes->get($rawTag)) { return $attributes->get($rawTag); } $output = e($this->{$tagName}); return str($output)->swap([ '`' => '\\`', '$' => '\\$', '{' => '\\{', '}' => '\\}', ])->wrap('`'); } public function asAlpineBool(ComponentAttributeBag $attributes, string $tagName): string { $rawTag = ':' . $tagName; if ($attributes->has($rawTag)) { return $attributes->get($rawTag); } return $this->{$tagName} ? 'true' : 'false'; } public function renderAlpineFallbackAttribute(ComponentAttributeBag $attributes, string $tagName, string $prop): string { return ':label="aaa"'; return new ComponentAttributeBag([]); return $attributes; } public function ca(ComponentAttributeBag $attributes): ComponentAttributeBag { return new ComponentAttributeBag([ '::value' => $attributes->get(':label'), ]); return ':value="$label" ::value="{!!$attributes->get(":label")!!}"'; } }