简体   繁体   中英

Php - Mobile + Web App : Laravel / Lumen or Both

I am building an application and currently focusing on the mobile part .

I wanted to use Lumen microframework for the server-side and Apis to connect to the mobile app.

However i also wanted to extend the application later on to build a website (Laravel)

They will both be using the same database .

I am wondering whether i should use Laravel directly and make it responsible for the apis too (albeit it would be slower for mobile apps)

Or i was wondering if i can use a combination of both.

Lumen - to deal with server requests eg : api.site.com/...

Laravel - to deal with the website eg : site.com/....

You could do either or, but I would suggest keeping the website and the API isolated.

I actually just finished up a similar project.

I have a mobile app built on Ionic, an API built on Lumen and an admin CMS built on Laravel. The CMS updates content in the API via authenticated API calls and then the app pulls from it.

If you take this route, you could make API calls from the CMS/Website using client side or server side requests. My CMS uses server side calls leveraging Guzzle .

I would suggest looking at sharing models between the two applications such that you don't have to update content via API calls. Here is a nice article on how to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM