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

How can i move the flash-toastr.min.js file for flasher-toastr-laravel from cdn to local #84

Closed
wcaaan opened this issue Aug 16, 2022 · 9 comments

Comments

@wcaaan
Copy link

wcaaan commented Aug 16, 2022

Hey,

First of all amazing package and very nice work. I can find the config file for flasher-laravel and i can override the js file there but how do i move the js file of this adapter "flasher-toastr-larave" from cdn to local.

Thankyou

@yoeunes
Copy link
Member

yoeunes commented Aug 16, 2022

Hello @wcaaan thanks for your words.

You could either download the cdn and copy it somewhere in the public folder, or use npm

npm i @flasher/flasher

here is a link in the doc : https://php-flasher.io/docs/framework/javascript/

@wcaaan
Copy link
Author

wcaaan commented Aug 18, 2022

thank you

@wcaaan
Copy link
Author

wcaaan commented Aug 18, 2022

I copied the flasher.min.js to public folder and override the root_script with the public folder file, that is working fine but
flasher-toastr.min.js is still called from cdn, i don't know why

@wcaaan
Copy link
Author

wcaaan commented Aug 18, 2022

would'nt it be better if there was a config file for adapter as well ? so if anyone can override the root_script ?

@yoeunes
Copy link
Member

yoeunes commented Aug 18, 2022

Yes you have to do the same for flasher-toastr.min.js, just create a config/flasher_toastr.php config file, and put this :

// config/flasher_toastr.php

return [
    'scripts' => [
         // path for jquery if it's not already added globally
         // path to the flasher-toastr.min.js
    ],
];

don't forget to add jquery as well for toastr to work correctly

@yoeunes
Copy link
Member

yoeunes commented Aug 18, 2022

@wcaaan
Copy link
Author

wcaaan commented Aug 18, 2022

Awesome, thankyou. also can you please tell me how can i pass the flasherInterface from view to show my validation errors, i tried checking out the blade documentation but its empty. appreciate the help.

@yoeunes
Copy link
Member

yoeunes commented Aug 22, 2022

Hello @wcaaan sorry for the late response.
I will answer you on the other issue : #86

@wcaaan
Copy link
Author

wcaaan commented Aug 24, 2022

No worries.

@yoeunes yoeunes closed this as completed Oct 29, 2022
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

2 participants