disabled / required attributes passed with Blade
supergreentony opened this issue · comments
Hy!
I wonder how can I specify with Blade a "disabled" attribute to the component
In my case, clients can be prevent from updating by the admin
For example, if I do
//$clientIsDisabled='disabled'
<x-form-input name="client_name" label="Name *" required {{ $clientIsDisabled }} />
The input is not rendered
Actually, I do something like this:
@if($clientIsDisabled)
<x-form-input name="client_name" label="Name *" required disabled />
@else
<x-form-input name="client_name" label="Name *" />
@endif
But it's ugly...
Do not use the component in that case is maybe the simplest solution?
Do I miss something?
How do you do in that situation?
Thank you!
<x-form-input name="client_name" label="Name *" :required="$clientIsDisabled" />