Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sgupta1979's avatar

Is laravelcollective/html usable with Laravel 12? Any alternatives?

Hi all, I'm upgrading a Laravel 10 project to Laravel 12 and noticed that the laravelcollective/html package is no longer compatible. I’ve been using it primarily for form generation in Blade templates, like:

My Questions: Can laravelcollective/html still be used with Laravel 12 through any workaround ?

What are the best alternatives for form generation in Laravel 12?

Refactoring to native Blade and HTML is an option, but since this is an existing project, it would require significant effort. Is there a modern package that offers similar functionality and is compatible with Laravel 12?

0 likes
4 replies
LaryAI's avatar
Level 58

Certainly! Here’s a detailed answer to your questions:

1. Can laravelcollective/html still be used with Laravel 12 through any workaround?

As of now, the laravelcollective/html package does not officially support Laravel 12. The last supported version is Laravel 10. While you could try to force-install it by updating your composer.json to relax the version constraints, you’ll likely run into incompatibilities due to changes in Laravel’s core (such as service provider and facade registration, or breaking changes in Blade).

Workaround:
If you want to try, you can attempt to require the package like this:

composer require laravelcollective/html --with-all-dependencies

Then, in your composer.json, you might need to change the version constraint for laravelcollective/html to:

"laravelcollective/html": "^6.4"

But this is not recommended for production, as you may encounter bugs or incompatibilities, and you won’t receive updates or security fixes.


2. What are the best alternatives for form generation in Laravel 12?

Here are some modern alternatives:

a. Native Blade + HTML

While it requires some refactoring, using plain HTML with Blade directives is the most future-proof and flexible approach. You can create reusable Blade components for your form elements:

Example:

<!-- resources/views/components/input.blade.php -->
<input 
    type="{{ $type ?? 'text' }}" 
    name="{{ $name }}" 
    value="{{ old($name, $value ?? '') }}" 
    {{ $attributes->merge(['class' => 'form-control']) }}>

Usage:

<x-input name="email" type="email" :value="$user->email" />

b. Blade UI Kit

Blade UI Kit is a collection of reusable Blade components, including form elements. It’s actively maintained and works well with Laravel 12.

Install:

composer require blade-ui-kit/blade-ui-kit

c. Laravel Form Components

Laravel Form Components is another package that provides Blade components for forms, inspired by Laravel Collective.

Install:

composer require protonemedia/laravel-form-components

Usage:

<x-form>
    <x-form-input name="email" label="Email" />
</x-form>

d. Custom Blade Components

You can also create your own set of Blade components tailored to your project’s needs, which is a good middle ground between using a package and writing raw HTML.


Summary Table:

Package/Method Laravel 12 Support Notes
laravelcollective/html Not maintained for Laravel 12
Blade UI Kit Modern, component-based
Laravel Form Components Similar API to Collective
Native Blade + HTML Most flexible, requires refactoring

Recommendation:
For new or upgraded projects, it’s best to move towards Blade components, either by using a package like Blade UI Kit or Laravel Form Components, or by building your own. This approach is more maintainable and compatible with the latest Laravel versions.

References:

Let me know if you need migration tips or code examples for refactoring!

Tray2's avatar

I would not recommend using any of those, the Spatie one is much better thanLaravelCollective, but like Lary stated, use components.

1 like
williamwanes's avatar

Use native Blade + HTML for forms (safer long-term). Create reusable Blade components for inputs/buttons. Consider Laravel Form Components (community packages on GitHub). If you want minimal refactor, fork LaravelCollective and update dependencies manually. I you need any mod app store for the help then oly get it from the trusted source: www.happymoodhub.com

Please or to participate in this conversation.