Use Blade components to build forms with Bootstrap.
- PHP 8.1+ or higher
- Laravel 8.0 or 9.0
You can install the package via composer:
composer sclaravel/laravel-form-components
Publish the configuration file and Blade views with the following command:
php artisan vendor:publish --provider="TysonLaravel\FormComponents\FormComponentServiceProvider"
<x-form::open :action="route(STORE_PRODUCT)">
<!-- Input only --->
<x-form::input name="name" :value="old('name')" required/>
<!-- With group & label --->
<x-form::group :label="trans('product.code')">
<x-form::input name="code" :value="old('code')"/>
</x-form::group>
<!-- Group configs--->
<x-form::group label=" " class="col" label-class="w-100">
<button type="submit" class="btn btn-danger">Submit</button>
</x-form::group>
</x-form::open>