Hi, First of all thank you for the wonderful review! I am the author of this package, i think you forgot the middleware that's come with this package with the help of middleware you don't need to create constructor in extended controller also there's no need for if statement too. Using the Middleware First thing first Let register the middleware in web middleware groups by simply adding the middleware class \RealRashid\SweetAlert\ToSweetAlert::class, into the $middlewareGroups of your app/Http/Kernel.php class. Examples Now within your controllers, just set your return message and send the proper message and proper type. public function FunctionName(Request $request) { return redirect('index')->with('success', 'Task Created Successfully!'); // OR return redirect('index')->withSuccess('Task Created Successfully!'); } for more info check out the documentation middleware section. realrashid.github.io/sweet-alert/
Thanks a lot Rashid! I've pinned your comment on top of all the comments so people would see that important information, sorry I missed it, maybe it wasn't that clear from the documentation.
@@RashidAli-pb9lr How do you handle delete confirmation from Controller ? How do we handle it with that package ? I didn't find any proper answer all over internet.
The other way to validate the session is in your master layout file. So you can validate if the sesion is success/error then display the message by firing the Alert function. For me it is more simple than touching the base controller + middleware thing. :)
Yes but then you can't do "use Alert;" and need to add all path \Something\Something\Alert::success('', '') which doesn't feel convenient either. That's kind of the whole point of this package - to not touch front-end, and perform all logic only in back-end files.
Wow thats really cool, Personally I love to use SweetAlert2 and Javascript it´s so cool, but definitely this way it´s much cleaner, thanks! you always have great tuts!
I don't have a video but you can google "sweetalert confirm", here's what I've found: stackoverflow.com/questions/31136889/how-to-use-confirm-using-sweet-alert
Not working in my case...I have made a folder Backend inside my controllers folder and I created all necessary controllers in that Backend Folder... I'm Including it to my master.blade.php and do just like you but not working
Hi,
First of all thank you for the wonderful review!
I am the author of this package,
i think you forgot the middleware that's come with this package with the help of middleware you don't need to create constructor in extended controller also there's no need for if statement too.
Using the Middleware
First thing first Let register the middleware in web middleware groups by simply adding the middleware class \RealRashid\SweetAlert\ToSweetAlert::class,
into the $middlewareGroups of your app/Http/Kernel.php class.
Examples
Now within your controllers, just set your return message and send the proper message and proper type.
public function FunctionName(Request $request)
{
return redirect('index')->with('success', 'Task Created Successfully!');
// OR
return redirect('index')->withSuccess('Task Created Successfully!');
}
for more info check out the documentation middleware section.
realrashid.github.io/sweet-alert/
Thanks a lot Rashid! I've pinned your comment on top of all the comments so people would see that important information, sorry I missed it, maybe it wasn't that clear from the documentation.
@@LaravelDaily in next release i will make documentation more clear.
I am also adding cdn support and more helper methods.
@@RashidAli-pb9lr How do you handle delete confirmation from Controller ? How do we handle it with that package ? I didn't find any proper answer all over internet.
@@erenergul1772 up
thank you rashid ali bhai for adding sweat alert
how do you handle a confirmation or cancel button whit this?
The other way to validate the session is in your master layout file. So you can validate if the sesion is success/error then display the message by firing the Alert function. For me it is more simple than touching the base controller + middleware thing. :)
Yes but then you can't do "use Alert;" and need to add all path \Something\Something\Alert::success('', '') which doesn't feel convenient either. That's kind of the whole point of this package - to not touch front-end, and perform all logic only in back-end files.
Wow thats really cool, Personally I love to use SweetAlert2 and Javascript it´s so cool, but definitely this way it´s much cleaner, thanks! you always have great tuts!
can it be used in livewire, like can the middleware work in livewire validation
Thanks for the video.... but how we send email through sweetalert by clicked "ok"? thx
Hy man, how can I change the fadeout time?
hi. does this work in laravel 10.
do you have vid for delete confirmation using that method ?
I don't have a video but you can google "sweetalert confirm", here's what I've found: stackoverflow.com/questions/31136889/how-to-use-confirm-using-sweet-alert
@@PovilasKorop Does this works with real rashid version?
how to add sweet alert on laravel 8 and vue.js 3
Finally! thank you so much.
How we send otp in mobile or email
Now this is a really great help! KUDOS!!!!! :D
Not working in my case...I have made a folder Backend inside my controllers folder and I created all necessary controllers in that Backend Folder... I'm Including it to my master.blade.php and do just like you but not working
Finally I did it
@@bibhasash7371 how
It worked
@@bibhasash7371 it woked for me too , but now i create another projet and when i display it , it doesnt it blocked my page
Thank you for great tut!
And I can't understand where exactly the error
how can use this to delete confirm,
i mean = ¿are you sure you want delete this item ¡?
yeah how should it work
Thanks a lot.
it woked thank you
THANKS MASTER
Thanks
Misunderstandable, have a nice day!
thank you for the wonderful review!