Comments (6)
Hi, I found the problem with the facades. the __destruct
method is not triggered.
sweet-alert/src/SweetAlert/SweetAlertNotifier.php
Lines 360 to 363 in fb88b73
I then tried placing the $this->flashConfig()
inside message()
method and it works as intended.
from sweet-alert.
Having the same issue with Laravel 6.
Only way I get this to work is if I use alert()->message('Message', 'Optional Title');
and also session based swal()
in my script section, which is yielded into main layout file.
For some reason in main layout file's script section the dynamic swal()
doesn't do the job.
And Facade method triggers nothing. :/ (Plus, @include('sweet::alert')
has to be in the main layout, otherwise it won't work either.)
I posted this comment here, but it's kinda related also to #93 and #115. I installed this via composer & npm, also tried with CDN. Also noticed that it didn't create its alias Alert
by itself, so I had to use FQN.
from sweet-alert.
Looks like there's some bug related to the Facade. I'm digging into the code to find out the bug. All help is appreciated!
from sweet-alert.
Hi, Sharing some of my findings
First Controller Action
SweetAlert::error('Some error');
dd(Session::get('sweet_alert')); // Displays the sweet alert config
return redirect()->route('some-route');
'some-route' Controller action
dd(Session::get('sweet_alert')); // Displays 'null'
The helper alert()->error()
doesn't work for me either. Im running Laravel 6.x. There might be some problems with the Session dependency or something has changed with how Laravel redirects. Will continue looking further and will update you when something comes up.
from sweet-alert.
THANKS "juliomotol" ! It's work for me !
-> I add "$this->flashConfig();" into the public function "message ()"
did you put "$this->flashConfig();" in the __destruct() or did you remove it?
from sweet-alert.
did you put "$this->flashConfig();" in the __destruct() or did you remove it?
Neither, I was just trying to figure out what could have been the problem and tried hacking the code a bit. I'd suggest using the helper functions for now until this is fixed.
from sweet-alert.
Related Issues (20)
- SweetAlert warning: "type" option has been deprecated. Please use "icon" instead. HOT 3
- Alert Facade doesn't work! HOT 13
- i used use UxWeb\SweetAlert\SweetAlert;
- Toast SweetAlert2 HOT 1
- Consider using SweetAlert2 instead of SweetAlert HOT 1
- Install issue with Laravel 7 HOT 1
- No hint path defined for [sweetalert] HOT 5
- alert() doesn't show when i use sweetAlert2 HOT 1
- how i can remove ok button
- multiple browsers HOT 1
- Disable for validaton? HOT 2
- Laravel 8 Support HOT 3
- Alert title and message blank when using redirect()->withErrors() HOT 3
- Form submits twice when using with Vue modal.
- allowOutsideClick doesn't work.
- when i click the button the sweet alert comes after refreshing or changing the page
- SA and LiveWire how ?
- Laravel 9.0 Support HOT 4
- Big Problem with Laravel 9 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sweet-alert.