luddinus's avatar

Lumen API in a Laravel Project

Hi.

I want to make an API based on Lumen and I want to use this API along many laravel projects.

Which is the best way to to this approach? Is this possible or I am misunderstanding things?

Thanks.

0 likes
2 replies
mohitmamoria's avatar

You will have to maintain two projects -

  1. A Lumen app that will act as API endpoints. The main purpose of this project will be to accept the requests, do minimal processing and throw a job in the queue.
  2. A Laravel app that will contain all your business logic and domain-specific code. This project will be listening to the jobs pushed in queue by the Lumen project and will process those.
luddinus's avatar

@mohitmamoria The Lumen API would have some classes (Repositories, Observers, etc.), so in the Laravel Project I would be able to use those classes as well, so I will have to mantain only the Lumen API.

More than API I would call a "package" based on Lumen.

Please or to participate in this conversation.