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

Update for Bootstrap 4 #502

Open
mikeerickson opened this issue Mar 5, 2019 · 9 comments
Open

Update for Bootstrap 4 #502

mikeerickson opened this issue Mar 5, 2019 · 9 comments

Comments

@mikeerickson
Copy link
Collaborator

The current version only supports Bootstrap 3. With Bootstrap 4 the de facto and latest release, this package will be enhanced to provide Bootstrap 4 support

@AdamKyle
Copy link

AdamKyle commented Mar 7, 2019

Actually they dont need to update for bootstrap 4, see the field basics. You can just replace those classes with any different bootstrap 4 classes.

And it works.

@mikeerickson
Copy link
Collaborator Author

@AdamKyle OK, I see what you are referencing here. My position is, we want to support Bootstrap 4 out of the box, as default. This will not affect existing users who have already published preferences as the publishing process will NOT overwrite existing users config.

@mikeerickson
Copy link
Collaborator Author

@AdamKyle Further, I am thinking outside the "box" here and trying to create an interface whereby we can support other CSS frameworks (ie Bulma, SemanticUI, etc.) Personally, I tend to use Bulma first as I am looking for something different than the mass amount of Bootstrap looking apps.

@ycs77
Copy link

ycs77 commented May 2, 2019

I provide a Bootstrap 4 template: https://github.com/ycs77/laravel-form-builder-bs4
Used after installation & publish. (If add --force attribute for publishing, will overwrite the Laravel form builder's original config and views)

@kristijanhusak
Copy link
Owner

Link added to Readme https://github.com/kristijanhusak/laravel-form-builder#bootstrap-4-support. Thanks @ycs77 .

@ycs77
Copy link

ycs77 commented May 2, 2019

Your welcome!

@MichaelVoelkel
Copy link

@ycs77 This does not seem to work. We have added this package and use Bootstrap 4 but using the "horizontal" update will still render all the radio buttons vertically to their label which looks really bad. In fact, if you look up the Bootstrap code at https://getbootstrap.com/docs/4.0/components/forms/ , it seems that you need to use form-check which is not apparent in the source code at all. And the files of your repository do not update these code parts anyways, as it seems.
Any help?

@ycs77
Copy link

ycs77 commented Aug 29, 2019

Hi @Elypson

Because the publish preset does not overwrite existing files, you can run php artisan vendor:publish --tag=laravel-form-builder-bs4-horizontal --force to force override Laravel form builder's config and views. Although you can switch to horizontal mode, BUT, the original Laravel form builder's config and views in your repository CAN NOT be retrieved. Please think twice.

And I use custom-control instead of form-check. If you are used form-check, you can modify the config after publishing.

@MichaelVoelkel
Copy link

MichaelVoelkel commented Aug 30, 2019

@ycs77 Okay, I frankly do not see any benefit of your repository and we have removed this from our project. But maybe I overlook something, maybe you could describe your repository's benefit more clearly in your README.md.

What works is to attach the corresponding CSS classes to @kristijanhusak's form. Our main issue lied in choice and this can be fixed with:

$choiceOptions = [
        'wrapper' => ['class' => 'form-check'],
        'label_attr' => ['class' => 'form-check-label'],
        'attr' => ['class' => 'form-check-input']
    ];

When adding a choice, use e.g.:

->add('name', 'choice', ['choice_options' => $choiceOptions]);

Now, everything is fine with @kristijanhusak's repository alone

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

No branches or pull requests

5 participants