30 lines
634 B
PHP
30 lines
634 B
PHP
<?php
|
|
|
|
namespace App\View\Form;
|
|
|
|
use App\View\Traits\HasFormDimensions;
|
|
use Illuminate\View\Component;
|
|
|
|
class Label extends Component
|
|
{
|
|
|
|
use HasFormDimensions;
|
|
|
|
public function __construct(
|
|
public bool $required = false,
|
|
) {
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return <<<'HTML'
|
|
<span class="font-semibold leading-none text-gray-400 group-[.size-default]:text-sm group-[.size-sm]:text-xs">
|
|
{{ $slot }}
|
|
@if ($required)
|
|
<span x-if="required" class="text-red-800"> *</span>
|
|
@endif
|
|
</span>
|
|
HTML;
|
|
}
|
|
}
|