初始版本
This commit is contained in:
44
src/DingNoticeServiceProvider.php
Normal file
44
src/DingNoticeServiceProvider.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace DingNotice;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class DingNoticeServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__ . '/../config/ding.php' => base_path('config/ding.php'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->registerLaravelBindings();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register Laravel bindings.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerLaravelBindings()
|
||||
{
|
||||
$this->app->singleton(DingTalk::class, function ($app) {
|
||||
return new DingTalk($app['config']['ding']);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user