Repository URL to install this package:
|
Version:
1.0.0 ▾
|
<?php
/**
* Created by PhpStorm.
* User: danilo
* Date: 27/07/16
* Time: 10:36
*/
namespace Modules\Core\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Core\Services\SocketBroadcaster;
class SocketServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Parent command namespace.
*
* @var string
*/
protected $namespace = 'Modules\\Core\\Commands\\Socket\\';
/**
* The available command shortname.
*
* @var array
*/
protected $commands = [
'Server',
'MakeListener'
];
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerConfig();
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
__DIR__ . '/../Config/socket.php' => config_path('socket.php'),
]);
$this->mergeConfigFrom(
__DIR__ . '/../Config/socket.php', 'socket'
);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
foreach ($this->commands as $command) {
$this->commands($this->namespace . $command);
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
$provides = [];
foreach ($this->commands as $command) {
$provides[] = $this->namespace . $command;
}
return $provides;
}
}