yoeunes / toastr

:eyes: toastr.js notifications for Laravel
https://php-flasher.io
MIT License
375 stars 52 forks source link

Limit the number of displayed toasts or option to clear the toasts #15

Closed rtfmfm closed 5 years ago

rtfmfm commented 5 years ago

Hello! At first place, I want to thank you for this project! It's great.

I have an issue using it in my app, because I need the option to set the maximum number of displayed toasts to 1, or option to clear previous toasts before the last toastr('') in the controller.

Are there such options available?

Thank you in advance!

yoeunes commented 5 years ago

Hello @rtfmfm thank you for using the toastr package, right now their is no option to limit the number of toastr it's a great idea i will try to implement it for later, but for your problem you can clean all toastr with the clear()method

toastr()->clear();
yoeunes commented 5 years ago

Hello again, i just push v1.2 which include 'maxItems' in the config file with limits the number of displayed toasts, and you can also set the limit in your controller

toastr()->maxItems(3);

thanks @rtfmfm for the idea

rtfmfm commented 5 years ago

Thank you very much! That was really fast! It's fine now.

THANK YOU!

yoeunes commented 5 years ago

you're welcome dude ^^