This commit is contained in:
parent
3920639f34
commit
da8854a62f
|
|
@ -9,14 +9,16 @@ class Input extends Component
|
|||
public string $name;
|
||||
public string $title;
|
||||
public string $value;
|
||||
public string $class;
|
||||
public bool $required;
|
||||
|
||||
public function __construct(string $name, string $title, ?string $value, bool $required = false)
|
||||
public function __construct(string $name, string $title, ?string $value, bool $required = false, ?string $class = '')
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->title = $title;
|
||||
$this->value = $value ?? '';
|
||||
$this->required = $required ?? false;
|
||||
$this->value = $value;
|
||||
$this->class = $class;
|
||||
$this->required = $required;
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<x-admin::form.row :title="$title" :required="$required">
|
||||
<input type="text" name="{{ $name }}" class="form-control wp-400" value="{{ $value }}" placeholder="{{ $title }}">
|
||||
<input type="text" name="{{ $name }}" class="form-control wp-400 {{ $class }}" value="{{ $value }}" placeholder="{{ $title }}">
|
||||
{{ $slot }}
|
||||
</x-admin::form.row>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<x-admin-form-input
|
||||
:name="$column['name']"
|
||||
:title="$column['label']"
|
||||
:class="$errors->has('name') ? 'is-invalid' : ''"
|
||||
:class="$errors->has($column['name']) ? 'is-invalid' : ''"
|
||||
:required="$column['required'] ? true : false"
|
||||
:value="old($column['value'], $column['value'] ?? '')">
|
||||
@if (isset($column['description']))
|
||||
|
|
|
|||
Loading…
Reference in New Issue