Cocur\Slugify\Bridge\Laravel\SlugifyServiceProvider::register PHP Метод

register() публичный Метод

Register the service provider.
public register ( ) : void
Результат void
    public function register()
    {
        $this->app->singleton('slugify', function () {
            return new Slugify();
        });
    }

Usage Example

Пример #1
0
 /**
  * @test
  * @covers Cocur\Slugify\Bridge\Laravel\SlugifyServiceProvider::register()
  */
 public function registerRegistersTheServiceProvider()
 {
     $this->provider->register();
     // the service provider is deferred, so this forces it to load
     $this->app->make('slugify');
     $this->assertArrayHasKey('slugify', $this->app);
     $this->assertInstanceOf('Cocur\\Slugify\\Slugify', $this->app['slugify']);
 }
SlugifyServiceProvider