yoeunes / toastr

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

jQuery Clashes #32

Closed NAK-Technologies closed 1 year ago

NAK-Technologies commented 1 year ago

Describe the bug A clear and concise description of what the bug is. package's jquery cdn often clashes with preloaded project's jquery and causes other libraries to malfunction. To Reproduce Steps to reproduce the behavior:

  1. Add a jquery cdn in your laravel project's base file.
  2. Use any other library which manipulates the DOM
  3. Execute toastr()
  4. Check console for the error of other library not found or "something is not a function"

Expected behavior A clear and concise description of what you expected to happen. It should run smoothly as it was without the toast Screenshots If applicable, add screenshots to help explain your problem. image Error occur with the toastr image

image After commenting this cdn it is working as it should.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

yoeunes commented 1 year ago

Hello @NAK-Technologies, thank you for providing a clear description of the issue. To clarify, yoeunes/toastr is just a proxy package that utilizes the functionality of PHPFlasher. To resolve the issue, please follow these steps:

  1. First, check the configuration for PHPFlasher at https://php-flasher.io/laravel/#-configuration. Note that this configuration is specific to PHPFlasher and not yoeunes/toastr.
  2. Next, use the command php artisan vendor:publish --force --tag=flasher-config to publish the configuration of PHPFlasher: config/flasher.php and config/flasher_toastr.php
  3. Thereafter, navigate to the file config/flasher_toastr.php.
  4. Lastly, remove the line referencing jQuery from the configuration file.

Please let me know if this resolves the issue or if you have any further questions 🙏.

NAK-Technologies commented 1 year ago

image this is my config folder as you can see it is not publishing flasher_toastr.php

yoeunes commented 1 year ago

Can you upgrade to v2.3.0 and follow the steps again

yoeunes commented 1 year ago

Closed as it's fixed in v2.3.0