I currently have two projects, a Lumen project called myproject-api and a Laravel project called myproject-app. When I deploy them I want to be able to use the Lumen API at api.myproject.com for the Laravel app at myproject.com. As I will also be developing a mobile app too (which will also use the Lumen API).
I would like to set up my Laravel project (myproject-app) to use the Lumen project (myproject-api) for all database related stuff.
How do I go about it with regards to routes etc, form submission. Could I encounter issues in the future when I deploy the apps?
When I've done stuff like this I treat the API almost like a repository - so I have a class that I can call things like $this->users->getAll() where $this->users handles the guzzle/json/blah stuff. The front-end is treated like a normal laravel app as far as routing/forms etc goes.
Is that what you mean?
Could I encounter issues in the future when I deploy the apps?
I just have routes that make sense for the front-facing app defined within the front-facing app as if it had no knowledge that it was API backed rather than DB backed. The API end can do as it likes for routes etc - partly that depends if the API will be used by sources other than the web front end app (mobile apps or the like).
Last time I used guzzle it was fairly straightforward to use - but I seem to remember hearing it's had a fairly big (and not for the better) re-write recently, but I might be wrong. I've used httpful in the past too which worked fine for my (fairly simple) needs.
If the apps are on the same server, I add each app to composers auto load. More so lumens to make use of the laravels models etc. no duplication!!!
Routes I keep separate for each app, the lumen routes I prefix with API/v1 (for example). If you want to call the routes in your Laravel app you can include the route file from lumin to Laravel with a require at the top of the Laravel routes.
Tip: change the default namespace from app to something distinct for Laravel and lumen.