Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tactician Container Laravel Package

league/tactician-container

PSR-11 container plugin for League Tactician that lazily loads command handlers from your DI container. Install via Composer and integrate with Tactician to resolve handlers on demand for cleaner wiring and faster bootstrap.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Architectural Decoupling: Enables clean separation of command handling logic from business logic by leveraging Tactician (a CQRS/ES command bus) with PSR-11 containers (e.g., Laravel’s DI container, Symfony’s DI, or custom implementations). This aligns with microservices, modular monoliths, or event-driven architectures where commands are processed asynchronously or in pipelines.
  • Lazy-Loaded Command Handlers: Reduces memory overhead by instantiating handlers only when commands are dispatched, improving performance in high-traffic systems (e.g., APIs, batch processors).
  • Roadmap for Scalability: Supports future-proofing by integrating with PSR-11-compliant containers, avoiding vendor lock-in (e.g., migrating from Laravel to Symfony or a custom framework).
  • Build vs. Buy: Buy for teams already using Tactician or PSR-11 containers (e.g., Laravel, Symfony, PHP-DI). Build only if needing custom container integration logic beyond PSR-11 standards.
  • Use Cases:
    • APIs: Route HTTP requests to command handlers via Tactician’s middleware pipeline (e.g., validation, logging, retries).
    • Background Jobs: Process commands in queues (e.g., Laravel Queues, RabbitMQ) with Tactician’s Bus abstraction.
    • Domain-Driven Design (DDD): Implement ubiquitous language by mapping commands to domain-specific handlers.
    • Testing: Mock command handlers easily via the container, improving unit/integration test isolation.

When to Consider This Package

  • Adopt if:
    • Your system uses Tactician (or plans to) for command handling.
    • You rely on a PSR-11 container (e.g., Laravel’s Illuminate\Container, Symfony’s DependencyInjection, or PHP-DI).
    • You need lazy-loaded command handlers to optimize memory usage.
    • Your architecture benefits from decoupled command processing (e.g., CQRS, event sourcing).
  • Look elsewhere if:
    • You’re not using Tactician: This package is a plugin for Tactician; without it, the value is zero.
    • Your container doesn’t implement PSR-11: Check compatibility (e.g., older Laravel versions or custom containers).
    • You need real-time command validation: Tactician’s middleware pipeline (enabled via this package) is ideal, but for synchronous validation, consider Laravel’s Form Requests or API Platform.
    • You require advanced container features: E.g., if you need tagged services or scoped bindings, ensure your container supports them (this package is minimalist).
    • Your team lacks PHP DI/PSR-11 experience: May require upskilling or additional tooling (e.g., Laravel’s service providers).

How to Pitch It (Stakeholders)

For Executives: "This package lets us scale command processing efficiently by integrating Tactician’s robust command bus with our existing dependency injection system. It reduces memory usage by loading handlers only when needed, which is critical for high-traffic APIs or batch jobs. By standardizing on PSR-11, we avoid vendor lock-in and future-proof our architecture for microservices or modular upgrades. The MIT license and League of Extraordinary Packages’ backing ensure reliability."

For Engineering/Architecture Teams: *"league/tactician-container bridges Tactician’s command bus with any PSR-11 container (e.g., Laravel, Symfony), enabling:

  • Lazy-loaded command handlers: Cut memory overhead in command-heavy systems.
  • Middleware pipeline support: Add cross-cutting concerns (logging, retries, auth) without bloating handlers.
  • PSR-11 compliance: Works with our existing DI setup, no framework-specific hacks.
  • Testability: Mock handlers via the container for isolated unit tests. Tradeoff: Minimal setup overhead if already using Tactician/PSR-11. Avoid if not aligned with CQRS or command-driven workflows."*

For Developers: *"Need to dispatch commands but tired of manual handler instantiation? This package lets you autowire Tactician handlers from your container (e.g., Laravel’s app() helper). Example:

// Register handler in container (Laravel example)
$this->app->bind(ProcessOrder::class, ProcessOrderHandler::class);

// Dispatch via Tactician
$bus->handle(new ProcessOrder($orderId)); // Handler loads lazily!

Pros: Clean separation, reusable middleware, zero Tactician config changes. Cons: Requires Tactician + PSR-11 container."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle