Hello. Lets say I have the following component. This component comes direct from jetstream.
@props(['disabled' => false])
<input {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm']) !!}>
I use this component in my blade like this:
<x-input id="organization_name" type="text" required
min="1" max="128"
class="mt-1 block w-full placeholder-gray-400"
wire:model="org_name"
autocomplete="organization"
placeholder="Microsoft"/>
In the current situation the required field is present is or not. Only now I want to set the required attribute based on a condition. Laravel provides a @required tag so I used that as followed:
<x-input id="organization_name" type="text" @required($contains_reseller)
min="1" max="128"
class="mt-1 block w-full placeholder-gray-400"
wire:model="org_name"
autocomplete="organization"
placeholder="Microsoft"/>
When I do this, the code 'breaks' in which instead of displaying input in the HTML, it displays x-input, so it fails to render the component correctly. [pic]
How could I resolve this? I rather dont want to change too much since also Jetstream forms depend on the existing code.