Skip to content

Instantly share code, notes, and snippets.

@kirkbushell
Created December 31, 2014 02:03
Show Gist options
  • Save kirkbushell/67eedb13c96f0d19cb72 to your computer and use it in GitHub Desktop.
Save kirkbushell/67eedb13c96f0d19cb72 to your computer and use it in GitHub Desktop.
class UsersServiceProvider extends ServiceProvider
{
/**
* Defer until needed.
*/
public $defer = true;
/**
* Repositories defined by the users module.
*
* @var array
*/
protected $repositories = [
UserRepositoryInterface::class => EloquentUserRepository::class
];
/**
* Define the listeners for this module.
*
* @var array
*/
protected $listeners = [
'Tectonic.Shift.Modules.Identity.Users.Events.UserHasRegistered' => NotificationListener::class
];
/**
* Ensure that the repository interface can be bound once called.
*
* @return array
*/
public function provides()
{
return [
UserRepositoryInterface::class
];
}
/**
* There are some events that require the service provider to be registered.
*
* @return array
*/
public function when()
{
return [
'Tectonic.Shift.Modules.Identity.Users.Events.UserHasRegistered'
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment