Skip to content

Core PHP FrameworkModular Monolith for Laravel

Event-driven architecture with lazy module loading and built-in multi-tenancy

Quick Start

bash
# Install via Composer
composer require host-uk/core

# Create a module
php artisan make:mod Commerce

# Register lifecycle events
class Boot
{
    public static array $listens = [
        WebRoutesRegistering::class => 'onWebRoutes',
    ];

    public function onWebRoutes(WebRoutesRegistering $event): void
    {
        $event->routes(fn () => require __DIR__.'/Routes/web.php');
    }
}

Why Core PHP?

Traditional Laravel applications grow into monoliths with tight coupling and unclear boundaries. Microservices add complexity you may not need. Core PHP provides a middle ground: a structured monolith with clear module boundaries, lazy loading, and the ability to extract services later if needed.

Key Benefits

  • Reduced Complexity - No network overhead, distributed tracing, or service mesh
  • Clear Boundaries - Modules have explicit dependencies via lifecycle events
  • Performance - Lazy loading means unused modules aren't loaded
  • Flexibility - Start monolithic, extract services when it makes sense
  • Type Safety - Full IDE support with no RPC serialization

Packages

Core

Event-driven architecture, module system, actions pattern, and multi-tenancy.

Admin

Livewire-powered admin panel with global search and service management.

API

REST API with OpenAPI docs, rate limiting, webhook signing, and secure keys.

MCP

Model Context Protocol tools for AI integrations with analytics and security.

Community

  • GitHub Discussions - Ask questions and share ideas
  • Issue Tracker - Report bugs and request features
  • Contributing - See our contributing guide

Released under the EUPL-1.2 License.