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

SweetAlert2 Compatibility #62

Closed
joerjoers opened this issue Sep 25, 2017 · 20 comments
Closed

SweetAlert2 Compatibility #62

joerjoers opened this issue Sep 25, 2017 · 20 comments

Comments

@joerjoers
Copy link

Most of the function are no longer working in SweetAlert2.
Example:
alert()->success('Message', 'title'); is no longer working as a Success Alert but a normal alert.

@ashish328
Copy link

ashish328 commented Oct 6, 2017

the upgraded package of sweetalert1.x to sweetalert2.0 is not working as expected icons are missing while using it.

@legreco
Copy link

legreco commented Oct 16, 2017

The icons are showing correctly on my side

@uxweb
Copy link
Owner

uxweb commented Oct 17, 2017

@joerjoers

There are some breaking changes in the sweet alert 2 javascript API.

This package is intended to work with v1 of sweet alert javascript.

To Add compatibility with sweet alert 2 I would need to make a new release which will not be backwards compatible.

So the versions will be as:

V1.* => sweet-alert compatible

V2.* => sweet-alert-2 compatible

What do you thing guys? Does this looks good to you?

@uxweb
Copy link
Owner

uxweb commented Oct 17, 2017

Ok Guys, I see that the same sweet alert package from npm has upgraded to v2 officially. Then I will upgrade this package to work with the sweet-alert2 javascript library.

I need to review the breaking changes as published here:

https://sweetalert.js.org/guides/#upgrading-from-1x

@legreco
Copy link

legreco commented Oct 17, 2017

will the upgraded package laravel 5.5 compatible?

@R00118189
Copy link

@uxweb when can we expect PR merge? and full SweetAlert2 compatibility?

@uxweb
Copy link
Owner

uxweb commented Oct 24, 2017

@legreco
Yes, it is compatible with Laravel 5.*.

@R00118189
We are working on the new version. It'll be ready for the next week (at the end of October).

Thanks for all your help and support.

@OGhawsi
Copy link

OGhawsi commented Nov 5, 2017

I am also getting just a normal alert for all types of messages. Can someone help? I am using Laravel 5.5
@uxweb

@zietbukuel
Copy link

I'm also having this same issue on Laravel 5.5. I'm just getting a normal/regular message popup, changing the type of messages always produces the same result.

@OGhawsi
Copy link

OGhawsi commented Nov 13, 2017

Does anybody know if the problem is solved because I am running out of time to deploy my app.
Thanks. @uxweb

@iLongRanger
Copy link

I am also waiting for the update.

@23andreas
Copy link

+1

@iLongRanger iLongRanger mentioned this issue Dec 17, 2017
@OGhawsi
Copy link

OGhawsi commented Jan 16, 2018

I have downloaded both css and js @1.1.3 and worked fine. Here is the link.
https://unpkg.com/sweetalert@1.1.3/dist/

@magnosis
Copy link

magnosis commented Feb 3, 2018

Do you guys have an ETA for v2?

Thank you so much for this package!!
I'm using it with sweetalert 1.1.3 in the meantime, works wonderfully. Great job!!

@addingama
Copy link

I can make it work with sweetalert 2.

I just need to export the config and view

 php artisan vendor:publish --provider "UxWeb\SweetAlert\SweetAlertServiceProvider"

then change the view resources/view/vendor/sweet/alert.blade.php to follow sweetalert 2 format

@if (Session::has('sweet_alert.alert'))
    <script>
        swal({
            text: "{!! Session::get('sweet_alert.text') !!}",
            title: "{!! Session::get('sweet_alert.title') !!}",
            timer: {!! Session::get('sweet_alert.timer') !!},
            icon: "{!! Session::get('sweet_alert.type') !!}",
            showConfirmButton: "{!! Session::get('sweet_alert.showConfirmButton') !!}",
            confirmButtonText: "{!! Session::get('sweet_alert.confirmButtonText') !!}",
            confirmButtonColor: "#AEDEF4"
        });
    </script>
@endif

I hope that can help

@Wasca
Copy link

Wasca commented Mar 1, 2018

@uxweb Just wondering if this is now compatible with SweetAlert2? https://sweetalert2.github.io/

@uxweb
Copy link
Owner

uxweb commented Jul 24, 2018

@Wasca @magnosis @iLongRanger @dashracer @OGhawsi

Guys, I'm very sorry for have making you wait for so long.

v2 is now ready!

I really appreciate all your support.

Best regards

@uxweb uxweb closed this as completed Jul 24, 2018
@doliskani
Copy link

Do not show me the icons too.

@prafful-panwar-ayur
Copy link

Icon not showing :(

@sncbtz
Copy link

sncbtz commented Jul 13, 2020

I can make it work with sweetalert 2.

I just need to export the config and view

 php artisan vendor:publish --provider "UxWeb\SweetAlert\SweetAlertServiceProvider"

then change the view resources/view/vendor/sweet/alert.blade.php to follow sweetalert 2 format

@if (Session::has('sweet_alert.alert'))
    <script>
        swal({
            text: "{!! Session::get('sweet_alert.text') !!}",
            title: "{!! Session::get('sweet_alert.title') !!}",
            timer: {!! Session::get('sweet_alert.timer') !!},
            icon: "{!! Session::get('sweet_alert.type') !!}",
            showConfirmButton: "{!! Session::get('sweet_alert.showConfirmButton') !!}",
            confirmButtonText: "{!! Session::get('sweet_alert.confirmButtonText') !!}",
            confirmButtonColor: "#AEDEF4"
        });
    </script>
@endif

I hope that can help

This is correct. But I had to change swal() function for swal.fire() because sweetalert2 exposes swal() as a class and I kept getting a console error "Cannot call a class as a function".

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