<?phpnamespace Illuminate\Pipeline;use Illuminate\Support\ServiceProvider;// namespace like service providerclass pipelineserviceprovider extends serviceprovider{// All this service provider //this is a pipeline service provider /** * indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true;// just like a parents // indicates if loading of the provider is deferred. /** * Register the service provider. * * @return &Nbsp;void */ public function register () { $this->app->singleton ( ' Illuminate\contracts\pipeline\hub ', ' Illuminate\pipeline\hub ' );// singleton method }//Register the service provider. /** * Get the services provided by the provider. * * @return array */ public function provides () { return [ ' Illuminate\contracts\pipeline\hub ', ];// return this }//Get The services provided by the provider.}
This article is from the "Focus on PHP" blog, please be sure to keep this source http://jingshanls.blog.51cto.com/3357095/1829008
[Li Jingshan php] every day laravel-20160924| piplineserviceprovider.php