2017 © Pedro Peláez
 

library laravel-container-info

Artisan commands for getting information about the IoC container.

image

smcrow/laravel-container-info

Artisan commands for getting information about the IoC container.

  • Monday, January 15, 2018
  • by cr0wst
  • Repository
  • 1 Watchers
  • 4 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 11 Versions
  • 6 % Grown

The README.md

Laravel Container Info

Latest Stable Version Latest Unstable Version Total Downloads Build Status, (*1)

This is a suite of custom commands for Artisan that gives information about the IoC container. The following commands are added:, (*2)

Working with Bindings

  • binding:list - Lists the registered bindings by showing the abstract (interface) and concrete class that will be injected.
    • --include-illuminate - Indicates that Illuminate classes should be included. They are not included by default.
  • binding:usage - Lists the registered bindings and which files they are referenced in. By default will exclude node_modules and vendor.
    • --include-illuminate - Indicates that Illuminate classes should be included. They are not included by default.
    • --include-vendor - Indicates that the vendor directory should be included. It is not included by default.
    • --exclude= - A comma separated string that indicates which directories to exclude.
    • --sort - Indicates that the information should be sorted.

Working with Service Providers

  • provider:list - Lists the registered service providers.
    • --include-illuminate - Indicates that Illuminate classes should be included. They are not included by default.
    • --sort - Indicates that the information should be sorted.

Usage

Install Through Composer

composer require smcrow/laravel-container-info --dev

Register the Command

Laravel 5.5

Laravel 5.5 allows for the auto-discovery of service providers. The ContainerInformationProvider will automatically be discovered., (*3)

Pre Laravel 5.5

You'll need to register the command in order for it to be usable. Modify the register method of AppServiceProvider This will add the provider for the local environment:, (*4)

public function register()
{
    if ($this->app->environment() === 'local') {
        $this->app->register(ContainerInformationProvider::class);
    }
}

Example Usage

php artisan binding:list

Here's sample output from the binding:list command from my LeaseTracker application., (*5)

+-----------------------------------------------------------------+--------------------------------------------------------------+
| Abstract                                                        | Concrete                                                     |
+-----------------------------------------------------------------+--------------------------------------------------------------+
| Illuminate\Contracts\Http\Kernel                                | LeaseTracker\Http\Kernel                                     |
| Illuminate\Contracts\Console\Kernel                             | LeaseTracker\Console\Kernel                                  |
| Illuminate\Contracts\Debug\ExceptionHandler                     | LeaseTracker\Exceptions\Handler                              |
| Illuminate\Session\Middleware\StartSession                      | Illuminate\Session\Middleware\StartSession                   |
| LeaseTracker\Services\Vehicle\VehicleServiceInterface           | LeaseTracker\Services\Vehicle\VehicleService                 |
| LeaseTracker\Services\Mileage\MileageServiceInterface           | LeaseTracker\Services\Mileage\MileageService                 |
| LeaseTracker\Services\Calculation\CalculationServiceInterface   | LeaseTracker\Services\Calculation\CalculationService         |
| LeaseTracker\Services\VehicleImage\VehicleImageServiceInterface | LeaseTracker\Services\VehicleImage\GoogleVehicleImageService |
| LeaseTracker\Repositories\VehicleRepositoryInterface            | LeaseTracker\Repositories\VehicleRepository                  |
| LeaseTracker\Repositories\MileEntryRepositoryInterface          | LeaseTracker\Repositories\MileEntryRepository                |
| Illuminate\Console\Scheduling\ScheduleFinishCommand             | Illuminate\Console\Scheduling\ScheduleFinishCommand          |
| Illuminate\Console\Scheduling\ScheduleRunCommand                | Illuminate\Console\Scheduling\ScheduleRunCommand             |
| Illuminate\Contracts\Pipeline\Hub                               | Illuminate\Pipeline\Hub                                      |
+-----------------------------------------------------------------+--------------------------------------------------------------+
php artisan provider:list

Here's sample output from a dummy application:, (*6)

+-----------------------------------------------------------------------------+----------+----------------+
| Providers                                                                   | Deferred | Provides       |
+-----------------------------------------------------------------------------+----------+----------------+
| Fideloper\Proxy\TrustedProxyServiceProvider                                 |          |                |
| Smcrow\ContainerInformation\BindingInformation\BindingInformationProvider   |          |                |
| Smcrow\ContainerInformation\ProviderInformation\ProviderInformationProvider |          |                |
| Smcrow\ContainerInformation\ContainerInformationProvider                    |          |                |
| App\Providers\AppServiceProvider                                            |          |                |
| App\Providers\AuthServiceProvider                                           |          |                |
| App\Providers\EventServiceProvider                                          |          |                |
| App\Providers\RouteServiceProvider                                          |          |                |
| Laravel\Tinker\TinkerServiceProvider                                        | true     | command.tinker |
+-----------------------------------------------------------------------------+----------+----------------+

Feedback and Contributions

Please feel free to offer suggestions by submitting an Issue. Alternatively, submit a pull request with any features you wish to add. This is a work-in-progress, and I would welcome any and all feedback., (*7)

The Versions

15/01 2018

dev-master

9999999-dev

Artisan commands for getting information about the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel container artisan

15/01 2018

dev-update-travis-to-run-phpunit

dev-update-travis-to-run-phpunit

Artisan commands for getting information about the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel container artisan

05/11 2017

1.2.2

1.2.2.0

Artisan commands for getting information about the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel container artisan

23/10 2017

dev-housekeeping-symfony-finder-and-additional-binding-usage-updates

dev-housekeeping-symfony-finder-and-additional-binding-usage-updates

Artisan commands for getting information about the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel container artisan

21/10 2017

1.2.1

1.2.1.0

Artisan commands for getting information about the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel container artisan

21/10 2017

1.2.0

1.2.0.0

Artisan commands for getting information about the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel container artisan

21/10 2017

1.1.0

1.1.0.0

Artisan commands for getting information about the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel container artisan

08/10 2017

1.0.2

1.0.2.0

Artisan commands for working with bindings and the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel artisan

08/08 2017

1.0.1

1.0.1.0

Artisan commands for working with bindings and the IoC container.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Crow

laravel artisan

30/07 2017

1.0.0

1.0.0.0

Artisan commands for working with bindings and the IoC container.

  Sources   Download

MIT

The Requires

 

by Steve Crow

laravel artisan

29/07 2017

1.0.0-alpha

1.0.0.0-alpha

Artisan commands for working with bindings and the IoC container.

  Sources   Download

MIT

The Requires

 

by Steve Crow

laravel artisan