PHPackages                             kroderdev/laravel-microservice-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. kroderdev/laravel-microservice-core

ActiveLibrary[Framework](/categories/framework)

kroderdev/laravel-microservice-core
===================================

A toolkit to use Laravel effectively as a microservice in a distributed architecture.

v0.5.0(6mo ago)61501[2 issues](https://github.com/KroderDev/laravel-microservice-core/issues)MITPHPPHP &gt;=8.1CI passing

Since Jun 17Pushed 1mo agoCompare

[ Source](https://github.com/KroderDev/laravel-microservice-core)[ Packagist](https://packagist.org/packages/kroderdev/laravel-microservice-core)[ RSS](/packages/kroderdev-laravel-microservice-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (23)Used By (0)

Laravel Microservice Core
=========================

[](#laravel-microservice-core)

[![Packagist Version](https://camo.githubusercontent.com/79756d630578e30f846334286bfa8f53d09e90acccde77e22ba9b10a0fcbefc5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b726f6465726465762f6c61726176656c2d6d6963726f736572766963652d636f72652e737667)](https://packagist.org/packages/kroderdev/laravel-microservice-core)[![Downloads](https://camo.githubusercontent.com/2936cb43f5112b5e47c5ca19e92786c469b8c6510426383b44a3efedef9c48cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b726f6465726465762f6c61726176656c2d6d6963726f736572766963652d636f72652e737667)](https://packagist.org/packages/kroderdev/laravel-microservice-core)[![License](https://camo.githubusercontent.com/afa4d87d0480489cd8e1c775b3d5c3e71c11df6981fcb3819a75a6b013e23c4b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b726f6465726465762f6c61726176656c2d6d6963726f736572766963652d636f72652e737667)](LICENSE)

A **Laravel package** that simplifies building microservices in **distributed architectures**. It provides authentication, request handling, and service-to-service communication tools to make Laravel scalable and production-ready in microservice environments.

Key Features
------------

[](#key-features)

This package packages common microservice concerns so you can focus on your service logic:

- JWT authentication middleware and a session guard for frontend interactions
- Correlation ID propagation for tracing requests across services
- Role and permission gates with convenient helpers
- HTTP client macros and a configurable API Gateway client
- Base model and query builder class for working with remote resources through the gateway
- Optional health check endpoint out of the box

Quick start
-----------

[](#quick-start)

Install the package via Composer:

```
composer require kroderdev/laravel-microservice-core
```

Publish the configuration to customize defaults:

```
php artisan vendor:publish --provider="Kroderdev\LaravelMicroserviceCore\Providers\MicroserviceServiceProvider"
```

Basic usage
-----------

[](#basic-usage)

Configure your API gateway URL and JWT settings in `config/microservice.php`. Then extend the base model to interact with remote resources:

Scaffold your remote model via the new Artisan command:

```
php artisan make:model RemoteUser --remote
```

This will generate a RemoteUser model that extends the core Model class with remote-resource support.

```
use Kroderdev\LaravelMicroserviceCore\Models\Model;

class RemoteUser extends Model
{
    protected static string $endpoint = '/users';
    protected $fillable = ['id', 'name'];
}

$users = RemoteUser::all();
```

Add the provided middleware to your routes to validate JWTs and propagate correlation IDs:

```
Route::middleware(['jwt.auth'])->group(function () {
    Route::get('/profile', fn () => 'ok');
});
```

Documentation
-------------

[](#documentation)

Full documentation lives in the [project wiki](https://github.com/KroderDev/laravel-microservice-core/wiki).

Contributing
------------

[](#contributing)

Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

License
-------

[](#license)

This project is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance72

Regular maintenance activity

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~28 days

Total

21

Last Release

203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18111250989b4d45b04aa8aff960bcaea47e6813a171a44679bd629d7c3eac40?d=identicon)[KroderDev](/maintainers/KroderDev)

---

Top Contributors

[![KroderDev](https://avatars.githubusercontent.com/u/142845401?v=4)](https://github.com/KroderDev "KroderDev (111 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

correlationdistributed-systemsjwt-authenticationlaravellaravel-packagemicroservicemicroservicesmiddleware-libraryrbac-authorization

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kroderdev-laravel-microservice-core/health.svg)

```
[![Health](https://phpackages.com/badges/kroderdev-laravel-microservice-core/health.svg)](https://phpackages.com/packages/kroderdev-laravel-microservice-core)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
