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

Alerts not showing on 5.4.11 #46

Closed
kieguin opened this issue Feb 22, 2017 · 9 comments
Closed

Alerts not showing on 5.4.11 #46

kieguin opened this issue Feb 22, 2017 · 9 comments

Comments

@kieguin
Copy link

kieguin commented Feb 22, 2017

So i am trying to at uxweb/sweet-alert to my project that is currently using 5.4.11.
I have used this on many projects before but none since i started using laravel 5.4.11

My Master Layout:

<link rel="stylesheet" href="{{url('/css/sweetalert.css')}}">
<link rel="stylesheet" href="{{url('/css/app.css')}}">
<script src="{{url('/js/sweetalert.js')}}"></script>
<script src="{{url('/js/app.js')}}"></script>
@include('sweet::alert')

My config/app.php:
UxWeb\SweetAlert\SweetAlertServiceProvider::class,

My Controller:

Alert::message('We will get back to you soon!', 'Thank you!');
return redirect()->route('home');

I have added use Auth; into my controller as well.

@Nathanw
Copy link

Nathanw commented Feb 28, 2017

Have you added 'Alert' => UxWeb\SweetAlert\SweetAlert::class, to your config/app.php? You will also need use Alert; at the top of your controller.

@kieguin
Copy link
Author

kieguin commented Feb 28, 2017

Yeah I have added both of these.

@Nathanw
Copy link

Nathanw commented Feb 28, 2017

Do you receive any error messages? Might be worth trying composer dump-autoload or php artisan config:cache as mentioned in #42.

@ramisohail
Copy link

same issue here exactly with 5.3, nothing happening at all

@kieguin
Copy link
Author

kieguin commented Mar 1, 2017

Ran both commands, And also tested on a fresh laravel project but still not working. No errors are showing, it just doesn't display the alert.

@Nathanw
Copy link

Nathanw commented Mar 1, 2017

I have just created a fresh install of laravel and included this package and everything has worked fine. Are you sure that the following is included on the layout where you want the alert to appear? Also are you sure that these files definitely exist?

<link rel="stylesheet" href="{{url('/css/sweetalert.css')}}">
<script src="{{url('/js/sweetalert.js')}}"></script>
@include('sweet::alert')

@ramisohail
Copy link

it worked for me after putting the @include('sweet::alert') in the Script tag i was just putting it in my view which doesnt work

@uxweb
Copy link
Owner

uxweb commented Mar 5, 2017

@doatyjs

If PHP is not squacking for some errors, maybe this is related to the load of sweetalert assets.

Try figuring out with chrome dev tools if all your assets are being loaded.

I just made a test with a fresh Laravel 5.4.15 installation and it works as expected.

image

If you need more help, please let me know, i'll be happy to help you!

@uxweb
Copy link
Owner

uxweb commented Mar 5, 2017

Thank you @Nathanw @ramisohail for helping @doatyjs to try solve this issue 👍

@uxweb uxweb closed this as completed Mar 27, 2017
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