Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jjmontalban's avatar

Get data from Api to Database

Hi

What would be the correct way to store my userdata get from API in the database?

I want to get my movie data stored in TMDB (https://developers.themoviedb.org/3)

I can get the data via axios in front with Vue. But my intention is to have my userdata (ratings, lists) stored in the backend to show. I have more than 2000 ratings and I need to store firstly.

Thanks in advance

0 likes
1 reply
tykus's avatar
tykus
Best Answer
Level 104

You can use Laravel's Http Client to fetch data from the API. You can do this in a Command, or a Job, which may be scheduled if needed. Everything else is just PHP code to handle the JSON payload (it will be available as a PHP array whenever you use the json method on the Response) that is returned by the client.

2 likes

Please or to participate in this conversation.