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..
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?
- Upload the video via the API and get the return data from Vimeo.
- 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.
Please or to participate in this conversation.