dficoins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

45 lines
942 B

<?php
/*
* @Descripttion:
* @version:
* @Author: GuaPi
* @Date: 2021-07-29 10:40:49
* @LastEditors: GuaPi
* @LastEditTime: 2021-08-07 00:04:12
*/
namespace App\Providers;
use App\SMSGateways\UnnameableGateway;
use Illuminate\Support\ServiceProvider;
use Overtrue\EasySms\EasySms;
class EasySmsServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
$this->app->singleton(EasySms::class, function ($app) {
return new EasySms(config('easysms'));
});
$this->app->alias(EasySms::class, 'easysms');
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
// 导入网关
$this->app->make('easysms')->extend('unnameable', function () {
return new UnnameableGateway(config('easysms.gateways.unnameable'));
});
}
}