On the Stomt blog today there's a post showing how you can share components across Laravel/Lumen applications using a simple structure and making things like microservices easier.
In this blog post, we show a way to split up large Laravel applications into smaller micro-services, in our case Laravel & Lumen applications, and the advantages and pitfalls it brings with it. As a result, we sped up our applications by more than 30% and achieved greater maintainability, too. These principles can, of course, be easily applied to other frameworks.A lot of functions are needed in our REST API as well as in our administration panel. [...] While we still have a “monolithic” codebase, we have multiple completely independent backend applications. You might want to call them “micro-services” (because it’s so trendy).
These microservices required similar functionality and splitting those out into shared components made sense. They walk you through some of the basic requirements they had when splitting the application and how the components are structured. They then shift over to the Laravel/Lumen side and show how multiple applications can be hosted via the same installation and where the shared components fit in. They show how to define namespaces to load the components and set up the providers so Laravel/Lumen knows how to use them.