- How do I install netojose/laravel-bootstrap-4-forms?
- Install it with Composer using composer require netojose/laravel-bootstrap-4-forms. On Laravel 5.5+ the service provider and facade are auto-discovered, so no manual registration is normally needed. You must also have Bootstrap 4 CSS and JS loaded in your front end, since the package only generates markup and does not ship styles. After that you can call the form builder facade directly inside your Blade templates.
- Which Laravel versions does laravel-bootstrap-4-forms support?
- The package declares support for Laravel 5, 6, 7, and 8. Its last tagged release was in January 2021, so Laravel 8 is effectively the practical ceiling. Laravel 9, 10, and 11 compatibility is not established and would require validating Composer constraints or maintaining a fork. Check the composer.json constraints against your PHP and Illuminate versions before committing.
- Does this package work with Bootstrap 5 or Laravel 9 and above?
- No, not out of the box. The package is built to emit Bootstrap 4 markup, including its validation state classes and input group structure, which differ from Bootstrap 5. It also has no verified support beyond Laravel 8. If you are planning a Bootstrap 5 migration or are already on Laravel 9+, use project-owned Blade components or a maintained alternative instead of introducing this dependency.
- How does model binding work with this form builder?
- You open a form with the model method, passing an Eloquent model or array, and the builder pre-fills fields from its attributes. You then chain field calls such as text, select, or textarea, and close the form with the close method. This is convenient for edit screens because you avoid writing conditional old-input and model-value logic in every input. Old input from a failed request still takes precedence over the stored model value.
- How are validation errors and old input handled?
- When a Laravel validation exception redirects back, the builder automatically reads the error bag and renders Bootstrap 4 invalid-feedback markup next to the relevant field, adding the is-invalid class to the input. Old input is repopulated so users do not lose what they typed. This removes most of the manual @error and old() boilerplate from your Blade views. You should still verify how your specific error display requirements, such as custom summaries or localized messages, are handled.
- What field types does the package support?
- It covers the common CRUD form elements: text, email, password, number, textarea, select, checkbox, radio, file uploads, and buttons. It also handles labels, input groups, help text, and inline or stacked layouts. More complex UI patterns, such as dynamic repeating fields, nested components, or custom accessibility markup, are not its focus and should be prototyped before you rely on them. Confirm the exact methods in the README for the version you install.
- Do I need to register the service provider or facade manually?
- On Laravel 5.5 and later, package auto-discovery registers the service provider and facade for you. On older Laravel versions, or if you have disabled discovery, you must add the provider to config/app.php and register the facade alias there manually. Manual registration is straightforward but easy to forget during upgrades, so confirm the facade resolves before building many views on top of it.
- Is this package still maintained, and is it safe to use in production?
- The last release was in January 2021 with support declared up to Laravel 8, so treat it as effectively abandoned. There is very little direct security surface because it only generates HTML markup, but an unmaintained dependency creates supply chain and Composer conflict risk during PHP and Laravel upgrades. It is acceptable for an existing Laravel 8 and Bootstrap 4 application if you encapsulate it behind your own Blade components. For new work, prefer native Blade components or a maintained fork.
- How does it compare to Laravel Collective HTML or native Blade components?
- Laravel Collective provides a general form and HTML builder but does not target Bootstrap 4 markup specifically, so you still write more markup yourself. Native Blade components give you full control, better IDE support, and no third-party lifecycle risk, but you must build the Bootstrap markup once. This package wins on speed for legacy Laravel 8 and Bootstrap 4 CRUD screens with many similar forms. Native components win on long-term maintainability and design flexibility.
- How should I test and encapsulate forms built with this package?
- Use standard Laravel feature tests to submit the forms and assert the expected redirects, validation errors, and database changes, plus assertSee checks on key markup when output matters. Wrap the builder in your own Blade components, such as a form input partial, so the package stays an implementation detail rather than a view-level standard. That wrapper makes it far cheaper to swap in native components or a fork when you upgrade Laravel or move to Bootstrap 5. Also verify CSRF handling, file uploads, and localization in a proof of concept before rolling it out widely.