Closed supergreentony closed 2 years ago
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" />
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
The input is not rendered
Actually, I do something like this:
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!