I'd go with AJAX Request :)
Javascript within a Blade View, Passing Variables between PHP and Javascript
So, PHP, server side, Javascript, client side... But when using something like Puppeteer (Javascript) for data mining, I need to pull data from the DB first, send variables from PHP to Javascript (Puppeteer, to mine the correct data), then the results from the mining (Javascript variables) need to be added/appended to the database to particular records, not just edited for screen view (client side).
I want to do this correctly with Laravel using models, routes, views, etc. But the passing back and forth may take multiple views, but maybe not. I also want to keep the Puppeteer Javascript in a separate file and call it when needed in the process.
Just looking for some logical suggestions of file structures and where to place each functional part of my code.
I have looked into using a utility like :
Transform PHP Vars to JavaScript https://github.com/laracasts/PHP-Vars-To-Js-Transformer
to help with the variable interchange, but I shy away from utility dependency, but I'm trying to use what works.
Please or to participate in this conversation.