PHPackages                             guiwoda/proxyvel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. guiwoda/proxyvel

Abandoned → [LaravelBA/proxyvel](/?search=LaravelBA%2Fproxyvel)Library[Framework](/categories/framework)

guiwoda/proxyvel
================

Service proxy for laravel's IoC container

181[1 issues](https://github.com/guiwoda/proxyvel/issues)PHP

Since Feb 19Pushed 11y ago2 watchersCompare

[ Source](https://github.com/guiwoda/proxyvel)[ Packagist](https://packagist.org/packages/guiwoda/proxyvel)[ RSS](/packages/guiwoda-proxyvel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Proxyvel
========

[](#proxyvel)

An implementation of [ProxyManager](https://github.com/Ocramius/ProxyManager) for Laravel.

Why?
----

[](#why)

When you do intensive constructor injection, a lot of objects will be needed in order to create your application. As php creates all your environment for each request, this is a lot of heavy lifting for php to do, and probably most of your object graph won't be used anyway.

This package helps you by giving you proxies instead of real objects.

For a way better explanation of this, [read what @Ocramius has to say about it](http://ocramius.github.io/presentations/proxy-pattern-in-php)or head to the [ProxyManager documentation](http://ocramius.github.io/ProxyManager/html-docs/)

Usage
-----

[](#usage)

Laravel's architecture is not flexible on the IoC container: The `Illuminate\Foundation\Application` object extends the `Illuminate\Container\Container` and that makes it hard to swap out.

This package provides two extensions, namely of `Application` and `Container`. You probably won't need both.

Also, this package provides a way to decide *which* objects will be proxied by the IoC container, through the `Specification` pattern:

```
// Proxy all the things!
$specification = new Proxyvel\Specifications\ProxyEverything;

// Proxy by the given namespaces
$specification = new Proxyvel\Specifications\ProxyNamespace([
    'App\Services',
    'App\Repositories'
]);

// Proxy only the given cases / class names
$specification = new Proxyvel\Specifications\ProxyCases([
    // You can always proxy Laravel's services by using the key Laravel sets
    'db',
    // Proxy some concrete classes
    'App\Services\FooService',
    // And some interfaces
    'App\Contracts\FooRepositoryInterface'
]);

// Proxy by regular expression (powerful, but usually complex)
$specification = new Proxyvel\Specifications\ProxyByRegExp([
    '/Interface$/', '/^Abstract/'
]);

// Combine multiple specifications
$specification = new Proxyvel\Specifications\ProxyCollection([
    new Proxyvel\Specifications\ProxyCases(/* ... */),
    new Proxyvel\Specifications\ProxyNamespace(/* ... */),
]);

// Define by negation (for those of you who see the glass half-empty)
$specification = new Proxyvel\Specifications\ProxyNegator(
    new Proxyvel\Specifications\ProxyNamespace('App\Entities')
);
```

### Usage in a Laravel project

[](#usage-in-a-laravel-project)

There's no `ServiceProvider` here. You'll need to edit your `bootstrap/start.php` file, and replace the `$app`variable with this package's `Application`:

```
// in bootstrap/start.php
$app = new Proxyvel\Application;

// If you don't call this, the container will just defer to Laravel's default behavior
$app->setProxyConfiguration(
    // Example Specification, build the one you need here
    new Proxyvel\Specifications\ProxyEverything,
    // Only instances of AbstractLazyFactory are accepted for now
    new ProxyManager\Factory\LazyLoadingValueHolderFactory
);
```

In a Laravel project, every instance of `Container` is resolved with the initial `Application`, so that's the only thing you'll ever need.

### Usage outside of a Laravel project

[](#usage-outside-of-a-laravel-project)

If you use Laravel's `Container` outside of a Laravel project, you'll need to instantiate this package's `Container`extension instead.

```
// Wherever you first instantiate it
$container = new Proxyvel\Container(
    // Example Specification, build the one you need here
    new Proxyvel\Specifications\ProxyEverything,
    // Only instances of AbstractLazyFactory are accepted for now
    new ProxyManager\Factory\LazyLoadingValueHolderFactory
);
```

Because of Liskov's substitution principle, this package's extension can be used in any place the `Container` is expected.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/34c0365f697eb3491eb619d8cad1f38bc68c7b7140842a7492c6a9d8753a07d5?d=identicon)[guiwoda](/maintainers/guiwoda)

---

Top Contributors

[![guiwoda](https://avatars.githubusercontent.com/u/1625545?v=4)](https://github.com/guiwoda "guiwoda (5 commits)")[![pechitook](https://avatars.githubusercontent.com/u/3620912?v=4)](https://github.com/pechitook "pechitook (1 commits)")

### Embed Badge

![Health badge](/badges/guiwoda-proxyvel/health.svg)

```
[![Health](https://phpackages.com/badges/guiwoda-proxyvel/health.svg)](https://phpackages.com/packages/guiwoda-proxyvel)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
