Create a Laravel / PHP script that runs periodically e.g. every 1 week to update my MySQL database with calls to an api
The reason for my question is because I've tried to implement this by just calling the api from my code within my website, but because there so many calls the initial page times out after 30 seconds, and you don't really want your users waiting longer than 2 / 3 seconds for a page on a website to load.
So I was wondering how I would write a Laravel / PHP function that would pull all the information from the API calls into my MSQL database and query the database instead. I was also wondering how I would get this to run periodically as mentioned in the subject.
Please let me know your thoughts, and what you reckon would be the best approach going forward in accomplishing this task which I was hoping would have been a lot more trivial than what it's turned out to be.