This commit adds two new components for handling form inputs in the private section of the site. 'Form.php' provides a base class for forms with methods for retrieving request names. 'Input.php' extends this to handle input fields specifically, allowing title, name, type, and value to be specified. An associated Blade view 'input.blade.php' has been added to render these inputs in views. This helps in reusability and maintainability.
This commit is contained in:
7
resources/views/private/components/forms/input.blade.php
Normal file
7
resources/views/private/components/forms/input.blade.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="mb-4">
|
||||
<label for="form-input-{{ $requestName }}">{{ $title }}</label>
|
||||
<input id="form-input-{{ $requestName }}" class="form-control @error($requestName) is-invalid @enderror" name="{{ $name }}" type="{{ $type }}" @if($type !== 'password') value="{{ $value }}" @endif {{ $attributes }}>
|
||||
@error($name)
|
||||
<span class="invalid-feedback">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
Reference in New Issue
Block a user