php-framework/docs/index.md

3.6 KiB
Raw Permalink Blame History

layout hero features
home
name text tagline actions
Core PHP Framework Modular Monolith for Laravel Event-driven architecture with lazy module loading and built-in multi-tenancy
theme text link
brand Get Started /guide/getting-started
theme text link
alt View on GitHub https://github.com/host-uk/core-php
icon title details
Event-Driven Modules Modules declare interest in lifecycle events and are only loaded when needed, reducing overhead for unused features.
icon title details
🔒 Multi-Tenant Isolation Automatic workspace scoping for Eloquent models with strict mode enforcement prevents data leakage.
icon title details
🎯 Actions Pattern Extract business logic into testable, reusable classes with automatic dependency injection.
icon title details
📝 Activity Logging Built-in audit trails for model changes with minimal setup using Spatie Activity Log.
icon title details
🌱 Seeder Auto-Discovery Automatic seeder ordering via priority and dependency attributes eliminates manual registration.
icon title details
🎨 HLCRF Layouts Data-driven composable layouts with infinite nesting for flexible UI structures.
icon title details
🔐 Security First Bouncer action gates, request whitelisting, and comprehensive input sanitization.
icon title details
🚀 Production Ready Battle-tested in production with comprehensive test coverage and security audits.

Quick Start

# 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