cuber's avatar

Lumen API + Laravel App

Im running two forge servers, L5 is on server 1 (with beanstalkd) and Lumen on server 2. Server 2 is used purely as an API and at some point it needs to inform Server 1 that a certain action has been fired, so that Server 1 could process the command, since Server 1 has all the commands.

Is it possible to fire an Event from Lumen (server2) but listen/process it on Server 1 ? Or using a Queue:push from Lumen is the best solution for this?

Thank you

0 likes
5 replies
taijuten's avatar

Whether what I'm going to suggest is the best way, I don't know. There may be better ways to accomplish this.

Use Curl! You could file a Curl request to a server with all the required information. The Server could verify the sender of the request either using some kind of token, or IP if the server won't be changing. A token may be more secure however.

1 like
cuber's avatar

Perhaps a Curl could be a temp solution.. and then fire an Event from the L5 server..

isaackearl's avatar

Ya I honestly wish there were more tutorials or some use case explanations of how you could use lumen alongside a laravel application...

cuber's avatar

Yea cause it makes sense to use Lumen as the API endpoint which could queue jobs for L5 app to process.

I managed to add a job to L5 server (beanstalkd) however the constructor of the job class is called only on the Lumen server and so L5 calls the handle method with no data

Please or to participate in this conversation.