vd/vendor/overtrue/laravel-pinyin/src/ServiceProvider.php
2018-12-18 16:46:51 +08:00

41 lines
784 B
PHP
Executable File

<?php
namespace Overtrue\LaravelPinyin;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
use Overtrue\Pinyin\Pinyin;
class ServiceProvider extends LaravelServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register the provider.
*
* @return void
*/
public function register()
{
$this->app->singleton(Pinyin::class, function($app)
{
return new Pinyin();
});
$this->app->alias(Pinyin::class, 'pinyin');
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [Pinyin::class, 'pinyin'];
}
}