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

taf's avatar
Level 2

Hosting my laravel app's videos through an API (Vimeo)

I am reaching the stage of an app I'm building where I would like to add videos. I have have chosen Vimeo as the place I would like to host the videos (ultimately youtube as well). From there, I plan to pull the videos back into my app similar to the way that Larcasts does for the free videos.

I've been following Laracast lessons till now and while I have a lot to learn still, humbly I'm happy with the way things are progressing. This said, I feel a little stuck at this point.

I generally understand the logistics of setting up the API but not within the context of Laravel. For example, when I’m creating a new video in VideosController, does the following pseudo seem right?


  1. Upload the video via the API and get the return data from Vimeo.
  2. Insert the data into the videos tables (id, name, description, vimeo_id

Where should I be housing the vimeo API code? I’m assuming not within the controller itself. Since it’s videos specific I guess it could fit in as a Helper or would it go in the model?

I’m sorry, I know I’m clearly missing some core understanding here. I don't want to go back to "muddle" programming practices where I just get things to function. Are there any lessons you can point out that I should refer to.

0 likes
2 replies
shez1983's avatar

i would create either an entity/repository or a service (what you choose to use is up to you, personally i would treate Youtube/Vimeo as a repository perhaps) .. if you are going to be using BOTH youtube/vimeo then create an interface..

taf's avatar
Level 2

@shez1983 thank you! This was exactly what I was looking for. I'll update the thread again once I have reviewed some laracasts and have worked out a plan.

Please or to participate in this conversation.