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

Manager Laravel Package

graham-campbell/manager

Adds a reusable “manager” layer for Laravel packages and apps, helping you build driver-based services (create, cache, and resolve drivers) with a consistent API. Supports Laravel 8–13 and PHP 7.4–8.5.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Unified Connection Management for Custom Packages: Accelerates development of Laravel packages requiring multi-driver support (e.g., payment gateways, third-party APIs, storage adapters) by providing a batteries-included manager pattern. Eliminates boilerplate for connection pooling, dynamic extension, and config resolution, reducing time-to-market for internal tools or open-source contributions.

    • Example: Build a Laravel-Notion package where users can switch between Notion API v1/v2 or self-hosted instances via Manager::extend('notion', fn() => new NotionV2Client()).
  • Modularization of Monolithic Services: Enables decomposition of large service classes (e.g., AuthService) into driver-specific managers (e.g., OAuth2Manager, LDAPManager) while maintaining a consistent API surface. Critical for teams adopting microservices or domain-driven design in Laravel.

    • Roadmap Tie: Aligns with initiatives to replace legacy monoliths (e.g., UserServiceAuthManager + ProfileManager).
  • Configuration-Driven Extensibility for SaaS Platforms: Allows end-users to add custom integrations without code changes via Manager::extend(). Ideal for:

    • Marketplace Platforms: Let vendors plug in proprietary payment gateways (e.g., Manager::extend('stripe', fn() => new CustomStripeGateway())).
    • Enterprise Customization: Extend core services (e.g., Manager::extend('logging', fn() => new SplunkLogger())) for compliance or legacy system integration.
    • Use Case: "Enable customers to connect to their internal CRM via a custom API driver" without requiring PM approval for code changes.
  • Legacy System Migration: Facilitates gradual modernization of older Laravel packages (L5/L6) by providing a backward-compatible abstraction layer. Teams can incrementally adopt Laravel 10+ features while preserving existing driver logic.

    • Example: Migrate a Laravel-5.5 package to Laravel 11 by wrapping its Connection class in AbstractManager.
  • Internal Tooling Standardization: Reduces technical debt in shared libraries by enforcing a single pattern for connection management across teams. Example: Replace ad-hoc DatabaseManager clones in different repos with a corporate-wide ServiceManager base class.


When to Consider This Package

  • Adopt When:

    • Building a Laravel package requiring multi-driver support (e.g., APIs, storage, payments) and want to avoid reinventing connection pooling.
    • Extending Laravel’s core services (e.g., auth, caching, logging) with custom drivers without modifying core files.
    • Creating a SaaS platform where end-users need to add proprietary integrations via configuration.
    • Migrating legacy Laravel packages (L5/L6) to newer versions while preserving driver logic.
    • Standardizing connection management across internal tools to reduce duplication.
  • Look Elsewhere When:

    • Your use case doesn’t require connection pooling (e.g., simple CRUD apps with a single database).
    • You need advanced features like connection health checks or retry logic (consider spatie/laravel-activitylog or custom solutions).
    • Your team lacks PHP/Laravel expertise to implement the abstract class properly (high learning curve for beginners).
    • You’re using non-Laravel frameworks (this package is Laravel-specific).
    • You require real-time connection monitoring (e.g., WebSocket managers; use beyondcode/laravel-websockets instead).

How to Pitch It (Stakeholders)

For Executives:

"This package lets us build and extend Laravel services faster by standardizing how we manage connections to external systems—like databases, APIs, or storage. Instead of writing custom connection logic for every new integration (e.g., a new payment gateway or cloud provider), we reuse a proven, lightweight framework that’s already used by packages like Laravel Flysystem. This reduces development time by 30–50% for multi-driver features and enables our SaaS customers to add their own integrations without code changes—a key differentiator for enterprise adoption. The MIT license and active maintenance (last update: March 2026) ensure long-term reliability."

For Engineering Teams:

*"Problem: Every time we add a new driver (e.g., a second payment processor or storage backend), we duplicate connection pooling, config resolution, and extension logic. This creates technical debt and slows down feature delivery. Solution: Use graham-campbell/manager to inherit a battle-tested manager pattern from Laravel’s core. Key benefits:

  • Zero boilerplate: Connection pooling, dynamic extension (Manager::extend()), and config resolution are built-in.
  • Consistency: Aligns with Laravel’s DatabaseManager, CacheManager, etc., so your team won’t reinvent the wheel.
  • Extensibility: Let end-users or internal teams add custom drivers via config (e.g., Manager::extend('s3', fn() => new CustomS3Client())).
  • Future-proof: Supports Laravel 8–13 and PHP 7.4–8.5, with active maintenance. Action: Replace ad-hoc manager classes in your next package or internal tool with AbstractManager. Example:
class PaymentManager extends AbstractManager {
    protected function createConnection(array $config) {
        return new StripeClient($config['api_key']);
    }
    protected function getConfigName() { return 'payments'; }
}

Impact: Faster development, fewer bugs, and easier maintenance for multi-driver features."*

For Developers:

*"Need to manage multiple connections (e.g., databases, APIs, storage) in a Laravel package or app? This package gives you: ✅ Connection pooling: Reuse connections instead of recreating them. ✅ Dynamic extension: Add custom drivers runtime via Manager::extend(). ✅ Magic methods: Call ->method() directly on the manager (e.g., ->upload() instead of ->connection()->upload()). ✅ Zero config: Just extend AbstractManager and implement two methods. Example Use Cases:

  • Build a Laravel-GitHub package with support for both REST and GraphQL APIs.
  • Let users switch between AWS S3, GCS, and Backblaze via config.
  • Extend Laravel’s AuthManager to support custom OAuth providers without modifying core files. Get Started:
composer require graham-campbell/manager

Docs: GitHub | Examples: Laravel Flysystem."*

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.
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui