for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: liuning
* Date: 2018/12/17
* Time: 10:35 AM.
*/
namespace Zing\LaravelSms;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;
use Zing\LaravelSms\Channels\SmsChannel;
class SmsServiceProvider extends ServiceProvider
{
public function boot()
if ($this->app->runningInConsole() && function_exists('config_path')) {
$this->publishes([
__DIR__ . '/../config/sms.php' => config_path('sms.php'),
], 'config');
}
$this->mergeConfigFrom(__DIR__ . '/../config/sms.php', 'sms');
public function register()
$this->app->singleton('sms', function (Application $app) {
return $app->make(SmsManager::class);
});
Notification::resolved(function (ChannelManager $service) {
$service->extend('sms', function (Application $app) {
return $app->make(SmsChannel::class);