Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove laravelcollective/html #684

Open
vanthao03596 opened this issue Apr 1, 2022 · 11 comments
Open

Remove laravelcollective/html #684

vanthao03596 opened this issue Apr 1, 2022 · 11 comments

Comments

@vanthao03596
Copy link

Laravel have good view component to build form, it would be great if we can remove laravelcollective/html

@rudiedirkx
Copy link
Collaborator

Do you have examples?

@philbates35
Copy link

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.

@rudiedirkx
Copy link
Collaborator

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 =(

@philbates35
Copy link

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.

@rudiedirkx
Copy link
Collaborator

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 ....

@philbates35
Copy link

@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.

@rudiedirkx
Copy link
Collaborator

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 LaravelCollective/html#741 (comment) and LaravelCollective/annotations#124 (comment)

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.

@philbates35
Copy link

philbates35 commented Aug 23, 2023

@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?

@rudiedirkx
Copy link
Collaborator

rudiedirkx commented Aug 23, 2023

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 LaravelCollective/annotations#124 (comment) 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?

@philbates35
Copy link

Looks good to me, thanks @rudiedirkx!

@wsslfnstr
Copy link

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 =(

The is an converter available https://laravelshift.com/convert-laravelcollective-html-to-spatie-laravel-html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants