Skip to content

Commit f10c713

Browse files
authored
Document new 'DeferrableProvider' interface
See laravel/framework#27067
1 parent 7151f32 commit f10c713

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

providers.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,24 +152,18 @@ If your provider is **only** registering bindings in the [service container](/do
152152

153153
Laravel compiles and stores a list of all of the services supplied by deferred service providers, along with the name of its service provider class. Then, only when you attempt to resolve one of these services does Laravel load the service provider.
154154

155-
To defer the loading of a provider, set the `defer` property to `true` and define a `provides` method. The `provides` method should return the service container bindings registered by the provider:
155+
To defer the loading of a provider, implement the `\Illuminate\Contracts\Support\DeferrableProvider` interface and define a `provides` method. The `provides` method should return the service container bindings registered by the provider:
156156

157157
<?php
158158

159159
namespace App\Providers;
160160

161161
use Riak\Connection;
162162
use Illuminate\Support\ServiceProvider;
163+
use Illuminate\Contracts\Support\DeferrableProvider;
163164

164-
class RiakServiceProvider extends ServiceProvider
165+
class RiakServiceProvider extends ServiceProvider implements DeferrableProvider
165166
{
166-
/**
167-
* Indicates if loading of the provider is deferred.
168-
*
169-
* @var bool
170-
*/
171-
protected $defer = true;
172-
173167
/**
174168
* Register the service provider.
175169
*

0 commit comments

Comments
 (0)