mercredi 2 janvier 2019

How to convert a Laravel project, to a laravel api?

I have a fully done project made with a Laravel back end and a react front end. The react app is wrapped in the Laravel code, and will be available only after a login and some selections, which are all done in laravel with its views. I want to make the react app as a standalone app, and make the laravel code into an api, served from a server via. an url, such that the react app will work by making requests to the laravel api.

So my first problem is the following: Is there a way to implement API to my laravel code which mimics my allready existing login implementation?

Since my question is pretty broad, I was not sure what code to provide with this question. The code follows the MVC design pattern, so feel free to ask for some parts of the code.

As a slight off-topic question (don't read this if you just want to help with the laravel stuff): The reason I want to decouple the laravel back end and the react front end app, is to wrap the react app in electron to make it an offline app, using the laravel backend. Is this a reasonable approach?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire