PHPackages                             juggernaut-lab/microservice-helper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. juggernaut-lab/microservice-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

juggernaut-lab/microservice-helper
==================================

A Laravel package for microservice teams to share migrations, enums, utilities, and scaffolding across multiple Laravel projects.

v0.1.1(5mo ago)02[2 PRs](https://github.com/juggernaut-lab/microservice-helper/pulls)MITPHPPHP ^8.2CI passing

Since Nov 27Pushed 1mo agoCompare

[ Source](https://github.com/juggernaut-lab/microservice-helper)[ Packagist](https://packagist.org/packages/juggernaut-lab/microservice-helper)[ Docs](https://github.com/juggernaut-lab/microservice-helper)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/juggernaut-lab-microservice-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (5)Used By (0)

Juggernaut Lab — Laravel Microservice Helper
============================================

[](#juggernaut-lab--laravel-microservice-helper)

A Laravel toolkit engineered to help microservice teams centralize and synchronize shared database migrations, enums, helpers, scaffolding generators, and core logic across multiple Laravel applications.

This package brings structure, consistency, and developer efficiency to multi-repo or multi-service Laravel environments.

What It Solves
--------------

[](#what-it-solves)

- Prevents schema drift across microservices
- Centralizes shared logic and reusable components
- Provides internal scaffolding for rapid package updates
- Enables safe and intelligent migration publishing
- Ensures predictable changes across distributed apps
- Eliminates duplication of enums, helpers, and domain classes
- Provides a workflow and tooling model for collaborative teams

Designed for engineering teams where multiple Laravel services depend on shared domain logic or a shared database.

---

Table of Contents
-----------------

[](#table-of-contents)

1. [Overview](#overview)
2. [Features](#features)
3. [Installation](#installation)
4. [Local Development (Symlink Mode)](#local-development-symlink-mode)
5. [Migration Management](#migration-management)
6. [Scaffolding System](#scaffolding-system)
7. [Commands](#commands)
8. [Recommended Workflow](#recommended-workflow)
9. [Handling Shared Environments (Staging/Prod)](#handling-shared-environments-stagingprod)
10. [Project Structure](#project-structure)
11. [Future Enhancements](#future-enhancements)

---

Overview
--------

[](#overview)

The **Juggernaut Lab — Laravel Microservice Helper** package acts as a foundational layer for multi-service Laravel ecosystems.

It centralizes:

- Database migrations
- Enums
- Shared business logic
- Scaffolding &amp; code generation
- Utilities and helper classes
- Schema definitions
- Internal developer tooling

This ensures every service remains aligned, even when multiple teams contribute to shared domain concepts.

---

Features
--------

[](#features)

### ✔ Centralized Shared Migrations

[](#-centralized-shared-migrations)

One source of truth for database schema shared across multiple Laravel apps.

### ✔ Smart Migration Publisher

[](#-smart-migration-publisher)

Publishes only new migrations to prevent duplication or corruption.

### ✔ Internal Scaffolding System

[](#-internal-scaffolding-system)

Generate shared components directly inside the package:

- Migrations
- Classes
- Enums
- Full “bundle” creation (migration + class + enum)

### ✔ Symlink-Aware Package Development

[](#-symlink-aware-package-development)

When installed via `path` repository, the package becomes editable in real time.

### ✔ Microservice-Ready Architecture

[](#-microservice-ready-architecture)

Ideal for teams operating multiple Laravel services backed by a shared or partially shared database.

---

Installation
------------

[](#installation)

Install via Composer:

```
composer require juggernaut-lab/microservice-helper
```

Publish package migrations:

```
php artisan juggernaut:publish-migrations
```

---

Local Development (Symlink Mode)
--------------------------------

[](#local-development-symlink-mode)

For package maintainers, Juggernaut Lab supports a **local symlink workflow** that enables real-time editing and testing.

### Benefits

[](#benefits)

- Live editing of package files
- No modifying vendor/ files
- Perfect for contributors improving the package
- Ideal for multi-developer collaboration

### Strict Rule

[](#strict-rule)

**Do NOT commit path repositories or symlink configs.**
Use a local-only override file.

### Step 1 — Create `composer.local.json`

[](#step-1--create-composerlocaljson)

```
composer.local.json

```

```
{
    "repositories": [
        {
            "type": "path",
            "url": "../microservice-helper",
            "options": { "symlink": true }
        }
    ]
}
```

### Step 2 — Gitignore It

[](#step-2--gitignore-it)

```
composer.local.json

```

### Step 3 — Install in Symlink Mode

[](#step-3--install-in-symlink-mode)

```
composer update juggernaut-lab/microservice-helper
```

### Result

[](#result)

- Maintainers work live within the package
- Nothing leaks into Git
- Staging/production do not use symlinks
- Team members stick to normal Composer installs

---

Migration Management
--------------------

[](#migration-management)

Shared migrations live inside the package:

```
microservice-helper/database/migrations/

```

Publish them into the host application:

```
php artisan juggernaut:publish-migrations
```

### How the Publisher Works

[](#how-the-publisher-works)

- Detects existing migrations
- Publishes only new files
- Protects against duplication
- Supports `--force` for overwrites
- Summarizes changes

Example output:

```
Total migrations in package:   1025
Existing in project already:   1023
Newly published migrations:    2

New migrations added:
  ✔ 2025_01_10_000000_add_wallets_table.php
  ✔ 2025_01_11_000000_create_invoice_table.php

```

---

Scaffolding System
------------------

[](#scaffolding-system)

Juggernaut Lab includes an internal scaffolding engine for generating new shared components.

All generated files are written **inside the package itself**, not inside the consuming Laravel project.

### Available Generators

[](#available-generators)

- Migration Generator
- Class Generator
- Enum Generator
- Full Bundle Generator (migration + class + enum)

This ensures every shared artifact remains consistent and centralized.

---

Commands
--------

[](#commands)

### 1. Publish Migrations

[](#1-publish-migrations)

```
php artisan juggernaut:publish-migrations
```

Force overwrite:

```
php artisan juggernaut:publish-migrations --force
```

---

### 2. Generate a Migration

[](#2-generate-a-migration)

```
php artisan juggernaut:make-migration create_orders_table --create=orders
```

Modify a table:

```
php artisan juggernaut:make-migration add_status_to_users --table=users
```

Generated into:

```
microservice-helper/database/migrations/

```

---

### 3. Generate a Class

[](#3-generate-a-class)

```
php artisan juggernaut:make-class MoneyFormatter
```

With namespace:

```
php artisan juggernaut:make-class TaxService --namespace=Services
```

---

### 4. Generate an Enum

[](#4-generate-an-enum)

```
php artisan juggernaut:make-enum UserStatus
```

---

### 5. Generate Everything (Migration + Class + Enum)

[](#5-generate-everything-migration--class--enum)

```
php artisan juggernaut:make-all Order --create=orders
```

---

Recommended Workflow
--------------------

[](#recommended-workflow)

This workflow ensures clean, safe collaboration between:

- Package maintainers
- Microservice developers
- Staging &amp; production environments

### 1. Package Maintainers

[](#1-package-maintainers)

Use symlink mode:

1. Enable via `composer.local.json`
2. Modify shared code/migrations/enums
3. Generate components using `juggernaut:make-*`
4. Publish updated migrations into local microservices
5. Push package updates to GitHub
6. Tag a release: ```
    git tag v1.1.0
    git push origin v1.1.0
    ```

### 2. Microservice Developers

[](#2-microservice-developers)

No symlink. No scaffolding.

Workflow:

```
git pull
composer install
php artisan migrate
```

### 3. Staging &amp; Production

[](#3-staging--production)

Never use symlink mode.

Workflow:

```
composer install --no-dev
php artisan migrate
```

#### Shared DB Rule

[](#shared-db-rule)

If multiple services share one DB:

```
DB_LEADER_SERVICE=true

```

Others:

```
DB_LEADER_SERVICE=false

```

---

Workflow Summary Table
----------------------

[](#workflow-summary-table)

RoleUses Symlink?Generates Code?Publishes Migrations?Runs Migrations?MaintainerYESYESYESYESTeam MemberNONONOYESStagingNONONOYES (leader only)ProductionNONONOYES (leader only)---

Project Structure
-----------------

[](#project-structure)

```
microservice-helper/
├── src/
│   ├── Commands/
│   │   ├── PublishMigrationsCommand.php
│   │   ├── MakeMigrationCommand.php
│   │   ├── MakeClassCommand.php
│   │   ├── MakeEnumCommand.php
│   │   └── MakeAllCommand.php
│   ├── MicroserviceHelperServiceProvider.php
│   └── ...
├── database/
│   └── migrations/
├── stubs/
│   ├── class.stub
│   └── enum.stub
└── composer.json

```

---

Future Enhancements
-------------------

[](#future-enhancements)

- Dry-run mode for migration publishing
- Hash-based migration integrity checks
- JSON output mode for CI pipelines
- Additional scaffold types (DTOs, services, events, models)
- Domain module generators
- Diagnostics tooling (`juggernaut:doctor`)
- Automatic Pint formatting on generation

---

Conclusion
----------

[](#conclusion)

The **Juggernaut Lab – Laravel Microservice Helper** provides a clean, scalable, team-friendly foundation for multi-service Laravel architectures.

It streamlines collaboration, prevents schema drift, centralizes business logic, and gives engineering teams a predictable workflow for managing shared domain components.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~0 days

Total

2

Last Release

172d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67c7a475450064ed137f90662a904e9af080b9e145d46567f018aab5bac4d35c?d=identicon)[m4-programmer](/maintainers/m4-programmer)

---

Top Contributors

[![m4-programmer](https://avatars.githubusercontent.com/u/101928953?v=4)](https://github.com/m4-programmer "m4-programmer (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelscaffoldingdeveloper-toolsMicroservicejuggernaut-labshared-migrations

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/juggernaut-lab-microservice-helper/health.svg)

```
[![Health](https://phpackages.com/badges/juggernaut-lab-microservice-helper/health.svg)](https://phpackages.com/packages/juggernaut-lab-microservice-helper)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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