View::make() not working properly inside of wizard
issue: stripe element not get loaded inside of view make
Actually i want to integrate the stripe payments , so i need to generate card token using their js element code (https://codepen.io/Dracarys115/pen/OzjxVg)
- I have to make the card payment inside of a multi step wizard and i have to implement the stripe card element in the second step
- So i have created a different blade for stripe element and placed that using View:make()
- But the problem is stripe js elements are not loading in second step. If i put the view in first step it is showing but when i select or update any value in the form the stripe element not loaded
- i think its also happening with when i am changing the step
is there any way to get the things work properly?
code- https://gist.github.com/ckbsbal/87db36c930c0a4434485d6b9b6567b64
Solution:Jump to solution
That’s because it’s re-rendering it which is how livewire works with reactive. So on rendering it would need to then process again
11 Replies
That's because the .js won't render as it's injected
the js files are parsed on load
Any other way i can achieve this?
Include the JS at run time, then use JS to initialise the element
Do you have any working example of this ? I can't see any feasible solution to implement this using blade file.
I went through the docs but unable to find a way, if any references availbe please provide
Well, look at the docs for how to include javascript:
https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files
Then read the docs of stripe on how to initialise it programitcally
thank you But i am using filament v2 this docs is for v3, i have done this
in my AppserviceProvider
Same principle applies click the v2 do
at intial load the card element get render but when i click on select field which is reactive, its get wiped
Solution
That’s because it’s re-rendering it which is how livewire works with reactive. So on rendering it would need to then process again
Livewire
Inline Scripts | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.