I have an existing REST API that handles user authentication/CRUD/etc, and I want to build a website on top of it using Laravel. So my plan is to create an admin account in the API for Laravel, then use guzzle to make all the upstream calls to the API. How does this then fit into the MVC structure of laravel? Do I just bypass the existing database structure and write my own model that mirrors all of the API calls, and a controller that deals with that model? I haven't found a huge amount about this from googling so I might be going about it completely wrong..
Don't know why you would do this unless you a java app or something like that but anyway, The way I would do it is use the Repository pattern so I would create your models as normal and then I would create a Repository and that would access your api . But if your only using laravel for the V in the MVC then I would use some javascript framework to build the V view layer. Also Laravel is not really MVC its more like HMVC framework.
I can give you a better guide if you let me know what your want to build on Laravel eg: page to show the data in your REST API. etc
Your very last sentence answered your question.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community