Support the ongoing development of Laravel.io →
Configuration Session Database

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..

Last updated 2 years ago.
0

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.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

kraftman kraftman Joined 26 Jun 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.