From d2c6beb3d9b28b1b89b6a647a428c11615ef32e4 Mon Sep 17 00:00:00 2001 From: Salman Zafar Date: Wed, 27 Feb 2019 12:28:27 +0500 Subject: [PATCH] Added facade support --- composer.json | 5 ++++- src/Facades/Mqtt.php | 20 ++++++++++++++++++++ src/MqttServiceProvider.php | 12 ++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/Facades/Mqtt.php diff --git a/composer.json b/composer.json index df19094..ca9fe1b 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,10 @@ "laravel": { "providers": [ "Salman\\Mqtt\\MqttServiceProvider" - ] + ], + "aliases": { + "Mqtt": "Salman\\Mqtt\\Facades\\Mqtt" + } } } } diff --git a/src/Facades/Mqtt.php b/src/Facades/Mqtt.php new file mode 100644 index 0000000..a6eb935 --- /dev/null +++ b/src/Facades/Mqtt.php @@ -0,0 +1,20 @@ +app->singleton('Mqtt',function (){ + return new Mqtt(); + }); + } + + /** + * @return array + */ + public function provides() + { + return array('Mqtt'); } }