initial commit

setting up the project
This commit is contained in:
Namoshek
2019-09-15 17:12:38 +02:00
commit c0bc99c781
7 changed files with 846 additions and 0 deletions

View File

@ -0,0 +1,64 @@
<?php
namespace PhpMqtt\Client;
use Illuminate\Support\ServiceProvider;
/**
* Registers the php-mqtt/laravel-client within the application.
*
* @package PhpMqtt\Client
*/
class MqttClientServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot(): void
{
$this->handleConfigs();
}
/**
* Register the service provider.
*
* @return void
*/
public function register(): void
{
// Bind any implementations.
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides(): array
{
return [];
}
/**
* Publishes and merges the configuration of the package.
*
* @return void
*/
protected function handleConfigs(): void
{
$configPath = __DIR__ . '/../config/mqtt-client.php';
$this->publishes([$configPath => config_path('mqtt-client.php')], 'config');
$this->mergeConfigFrom($configPath, 'mqtt-client');
}
}