2017 © Pedro PelĂĄez
 

library laravel-universal-service-provider

This Laravel service provider allows Laravel applications to use service providers as defined in container-interop/service-provider

image

thecodingmachine/laravel-universal-service-provider

This Laravel service provider allows Laravel applications to use service providers as defined in container-interop/service-provider

  • Thursday, September 21, 2017
  • by mouf
  • Repository
  • 5 Watchers
  • 2 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

container-interop/service-provider bridge for Laravel

Import service-provider as defined in container-interop into a Laravel application., (*1)

Usage

Installation

Add the package in composer:, (*2)

composer require thecodingmachine/laravel-universal-service-provider ^1.0

Add \TheCodingMachine\Laravel\ContainerInteropBridgeServiceProvider in your config/app.php file., (*3)

config/app.php, (*4)

<?php

return [
    //...
    'providers' => [
        //...
        TheCodingMachine\Laravel\ContainerInteropBridgeServiceProvider::class
    ],
    //...
];      

Usage using thecodingmachine/discovery

The bridge will use thecodingmachine/discovery to automatically discover the universal service providers of your project. If the service provider you are loading publishes itself on thecodingmachine/discovery, then you are done. The services declared in the service provider are available in the Laravel container!, (*5)

Usage using manual declaration

If the service provider you are using does not publishes itself using thecodingmachine/discovery, you will have to declare it manually in the container-interop-service-providers key of your `config/app.php' file., (*6)

Set the service provider fully qualified class name in the parameter container-interop-service-providers:, (*7)

config/app.php, (*8)

<?php
use \GlideModule\GlideServiceProvider;

return [
  ...
  'container-interop-service-providers' => [
    GlideServiceProvider::class
  ]
];

Now, you can do : $app->make('glide'), (*9)

Disabling discovery

You can disable discovery using the container-interop-service-provider-enable-discovery setting:, (*10)

config/app.php, (*11)

<?php
use \GlideModule\GlideServiceProvider;

return [
  ...
  'container-interop-service-provider-enable-discovery' => false
];

Purging the cache

The Laravel service provider in this package is a deferred provider., (*12)

Laravel compiles and stores a list of all of the services supplied by this provider. Then, only when you attempt to resolve one of these services does Laravel load the service provider., (*13)

If you add a new service to one of the universal service providers, you will need to purge the "compiled" services. You can do this with this command line:, (*14)

php artisan clear-compiled

The Versions

21/09 2017

1.0.x-dev

1.0.9999999.9999999-dev

This Laravel service provider allows Laravel applications to use service providers as defined in container-interop/service-provider

  Sources   Download

MIT

The Requires

 

laravel psr-11 container-interop service-provider

24/10 2016

v0.3.0

0.3.0.0

This Laravel service provider allows Laravel applications to use service providers as defined in container-interop/service-provider

  Sources   Download

MIT

The Requires

 

laravel psr-11 container-interop service-provider

07/03 2016

v0.2.0

0.2.0.0

This Laravel service provider allows Laravel applications to use service providers as defined in container-interop/service-provider

  Sources   Download

MIT

The Requires

 

laravel psr-11 container-interop service-provider