Skip to content

Instantly share code, notes, and snippets.

@orobogenius
Created February 20, 2019 19:55
Show Gist options
  • Save orobogenius/36a81a8c3fe86c562dbcba676b67b07a to your computer and use it in GitHub Desktop.
Save orobogenius/36a81a8c3fe86c562dbcba676b67b07a to your computer and use it in GitHub Desktop.
ServiceProvider for SMS Component
<?php
namespace App\Providers;
use App\Components\Sms\SmsManager;
use Illuminate\Support\ServiceProvider;
class SmsServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->singleton('sms', function ($app) {
return new SmsManager($app);
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return ['sms'];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment