laravel-form-builder
laravel-form-builder copied to clipboard
Remove laravelcollective/html
Laravel have good view component to build form, it would be great if we can remove laravelcollective/html
Do you have examples?
laravelcollective/html is now abandoned, and there's no guarantee that it will be updated to support Laravel 11, at the moment it is fixed to support up to Laravel 10 only (https://github.com/LaravelCollective/html/blob/6.x/composer.json#L22).
It would be worth coming up with a plan for what to do here.
I'm sure it won't be updated to support laravel 11.
I would probably fork it, or publish it with a different name and then "provides":
in composer, because it works perfectly. Not great options, I know. But converting to spatie/laravel-html
is massive, if even possible.
It's such a shame laravelcollective didn't just pass the baton. I've asked many times to take over, and other have too, but no dice =(
I would probably fork it
Someone forked it already which is published at https://github.com/LaravelLux/html - though there's nothing to say that that fork will become the "official fork" or whether that fork will continue to be maintained, its too early to tell really.
That won't work. Changing the namespace is too breaking. It should have changed nothing and used composer's replace
or provide
. That would be my fork. Change nothing, only the composer require ...
.
@rudiedirkx that makes sense.
For context, in our project we use both this package as well as laravelcollective/html directly in hundreds of places, so as this package also pulls in laravelcollective/html we'll probably do whatever you guys decide to do here to avoid having two almost identical but slightly different forks in the same project.
So is that fork you describe something you are seriously planning to do in order to support Laravel 11+? If so, I will hold off making any changes in our project, until that fork is available, then I'll switch out laravelcollective/html for that fork in our project too when its available and this package has also swapped it out.
we use both this package as well as laravelcollective/html directly in hundreds of places, so as this package also pulls in laravelcollective/html
I do that too in several projects.
I've recently changed require laravelcollective/html
to require rdx/laravelcollective-html
and nothing else, with the power of Composer's replace
. See https://github.com/LaravelCollective/html/issues/741#issuecomment-1674134427 and https://github.com/LaravelCollective/annotations/issues/124#issuecomment-1673990018
Works like a charm. Perfectly backward and forward comatible. As long as I maintain rdx/laravelcollective-html and other packages keep requiring laravelcollective/html:6.x
, so I can keep maintaining 6.x
. It's not perfect forever, but it's pretty perfect for now.
@rudiedirkx so you're saying that we don't need to update this laravel-form-builder package's composer.json to require the fork, instead it is up to us in each project's composer.json to require the fork and also add a replace
section? I.e. there's no actual changed to made in this repo?
You don't have to do anything with "replace"
. The laravelcollective/html
replacement package (rdx/laravelcollective-html
) does that in its composer.json
. All you have to do is composer require rdx/laravelcollective-html
, and if you explicitly required html
before, remove it. See the 3 steps in https://github.com/LaravelCollective/annotations/issues/124#issuecomment-1673990018 but for html
instead of annotations
. (I use both, so I've done both.)
The form builder package will keep requiring laravelcollective/html
, and that will work too, but with a deprecated warning, and at some point it breaks for Laravel 11. Unless you require rdx/laravelcollective-html
and then everything works again 👍
I've added the install steps in https://github.com/rudiedirkx/laravelcollective-html, maybe that's clear enough?
Looks good to me, thanks @rudiedirkx!
I'm sure it won't be updated to support laravel 11.
I would probably fork it, or publish it with a different name and then
"provides":
in composer, because it works perfectly. Not great options, I know. But converting tospatie/laravel-html
is massive, if even possible.It's such a shame laravelcollective didn't just pass the baton. I've asked many times to take over, and other have too, but no dice =(
The is an converter available https://laravelshift.com/convert-laravelcollective-html-to-spatie-laravel-html