Laravel Echo update prices on currencies?
Hi, I'm trying to make my application as real time as possible.
To keep this simple, I have 4 blocks on my website which tracks prices of cryptocurrencies, however these doesn't update in real-time, they update once you reload the page.
Now what I would want to do is to make it update every minute using laravel echo.
I currently have laravel echo server running for our notifications on the website which works really well, however I am not sure how to do these type of events.
Basicially I have these 4 blocks: https://i.imgur.com/mats2zo.png
Which are 4 different currencies, every user can select their own currencies and there is about 1500 to choose from.
Now we read in prices from an API every minute already using the kernel console and it updates every record in the database, but what I want is to send an event when the prices updates and update it client side aswell.
So I tried doing it by sending out a event for every currency and it worked out well, however this feels like the wrong way?
Shouldn't I just send out an array of all the prices every minute and then from there update the prices?
How would I do this the best way?
Currently my code looks like this but I'm not sure if im doing it right:
Please or to participate in this conversation.