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

Manager Provides Some Manager Functionality For Laravel

Frequently asked questions about Manager
How do I install graham-campbell/manager in a Laravel project?
Run `composer require graham-campbell/manager` to install the package. It supports Laravel 8–13 and PHP 7.4–8.5. No additional configuration is required unless you need custom drivers or facades, which can be set up via the `config/manager.php` file.
Can I use Laravel Manager for payment gateways like Stripe or PayPal?
Yes, Laravel Manager is perfect for payment gateways. Define drivers in your config, then resolve them via `Manager::connection('stripe')` or `Manager::connection('paypal')`. The package supports lazy resolution and caching for performance.
Does Laravel Manager support runtime driver extension (e.g., adding a custom driver without code changes)?
Absolutely. Use `Manager::extend('driver_name', CustomDriver::class)` to register drivers dynamically. This is ideal for plugins, SaaS multi-tenancy, or third-party integrations without modifying core code.
How do I mock or fake connections for testing?
Laravel Manager provides `Manager::fake()` for testing. You can also use `Manager::shouldReceive()` with Mockery to stub method calls. This works seamlessly with Laravel’s testing tools like `HttpTests` or `FeatureTests`.
Is Laravel Manager compatible with Laravel 5.x packages?
While the package officially supports Laravel 8–13, you can wrap older Laravel 5/6 packages in a Manager-compatible facade. Type hints may need adjustments, but the core abstraction remains compatible with modern Laravel conventions.
Can I use Laravel Manager for stateful connections like WebSocket streams?
Laravel Manager is optimized for stateless operations (e.g., API calls, database queries). For stateful connections like WebSockets, consider pairing it with Laravel’s event system or a dedicated connection manager to avoid leaks.
How do I handle configuration validation for drivers?
The package relies on Laravel’s config system, so invalid configs (e.g., missing API keys) may cause silent failures. Add validation in your driver’s `createConnection()` method or use Laravel’s `ValidatedConfig` trait to enforce rules.
Does Laravel Manager support async drivers (e.g., Guzzle HTTP clients with async-await)?
No, it lacks native async support. For async drivers, wrap them in a library like `spatie/async` or use `Manager::extend('http', fn() => new AsyncClient())` to integrate with Laravel’s async tools.
What are the performance implications of connection pooling?
Connection pooling improves performance for stateless operations by reusing instances. However, for high-throughput services, stale connections may cause issues. Use `Manager::reconnect()` or Laravel’s `app()->flush()` to manage connection lifecycles.
Are there alternatives to Laravel Manager for driver-based architectures?
Alternatives include Laravel’s built-in managers (e.g., `CacheManager`, `FilesystemManager`) or third-party packages like `spatie/laravel-activitylog` for auditing. However, Laravel Manager offers a lightweight, reusable abstraction tailored for custom driver systems without bloat.
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.
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
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle