- How do I install laravel-form-partials with Composer?
- Install it with composer require davide-casiraghi/laravel-form-partials and let Laravel's package auto-discovery register the service provider. Version 2.0.0 is the release line aimed at Laravel 7, so confirm the illuminate/support and PHP constraints in the package's composer.json before you run the command. If you publish any config or views, re-publish them after upgrading so your copies do not drift from the package defaults.
- Which Laravel versions does laravel-form-partials support?
- The only signal in the 2.0.0 release is that it updates the package for Laravel 7, so treat Laravel 7 as the confirmed floor and ceiling until you read the Composer constraints. There is no published evidence in the changelog that Laravel 8, 9, 10, or 11 are supported. Check the repository's composer.json and recent commit activity before assuming newer versions will resolve.
- Does laravel-form-partials work with Bootstrap 5?
- No, the package is built around Bootstrap 4 form markup, and Bootstrap 5 removed the form-group class and reworked input-group and custom form control classes. The partials will render, but the layout and spacing will not match Bootstrap 5 conventions. The cleanest fix is to publish or copy the partials into your own resources/views directory and update the classes there.
- How do I customize the form partials without editing vendor files?
- Publish the package views with php artisan vendor:publish and select the form-partials tag listed in the README, then edit the copies in resources/views/vendor. Laravel resolves the published version before the package version, so your changes take effect without touching vendor. Commit the published files so the customization survives a fresh composer install.
- Do these partials handle validation error states automatically?
- The package is designed to keep validation error states uniform, so the partials typically check the $errors bag and apply Bootstrap's is-invalid class and invalid-feedback block. The exact implementation depends on the individual partial, so open the source for the field you are using and confirm which error keys it expects. If your form uses nested or array field names, verify the dot-notation key matches before relying on it.
- Is laravel-form-partials a replacement for Laravel Collective HTML or form model binding?
- No, this package is a set of static Blade partials for Bootstrap 4 markup, not a form builder with model binding, macros, or an HTML facade. If you need open, model, and select helpers tied to Eloquent models, you need a form builder package or Laravel's own old() and @error directives. Many teams now use anonymous Blade components instead, which give the same reuse without a framework-version-coupled dependency.
- Can I use laravel-form-partials on Laravel 10 or 11?
- Blade partial syntax is stable, so the view files themselves will likely render on newer Laravel versions. The blocker is the package's Composer constraint on illuminate/support, which may stop installation, plus any service provider code tied to the Laravel 7 era. If you only want the markup, copy the partials into your app and drop the dependency.
- How do I test forms that use these Blade partials?
- The partials are just views, so standard Laravel feature tests cover them. Use $this->get() or $this->post() and assert the rendered HTML with assertSee for field names and classes, and assertSessionHasErrors for the validation path. Add a test that posts invalid data and asserts the is-invalid class appears so a future Bootstrap or partial change cannot silently break error styling.
- Is laravel-form-partials still maintained and safe for production?
- The 2.0.0 release only announces Laravel 7 support, and Laravel 7 reached end of life in March 2021, which suggests the package has not tracked later framework majors. Check the repository's last commit date, open issues, and release cadence before adopting it. For production, publishing the partials into your own codebase removes the abandonment risk entirely.
- What are the alternatives to laravel-form-partials?
- The closest alternatives are anonymous Blade components, which ship with Laravel and require no extra dependency, or a maintained form builder such as a Collective HTML community fork. Tailwind-based kits like Blade UI Kit serve the same reuse goal if you are not tied to Bootstrap 4. If you only need a handful of fields, copying the partial markup you like into your own components is usually less work than integrating a package.