From 133aaff3e7891e5875c466a9a4bcf352bdc8f56d Mon Sep 17 00:00:00 2001 From: Maxime Renou Date: Tue, 12 May 2020 12:47:10 +0200 Subject: [PATCH] Facade --- composer.json | 5 ++++- src/Connect.php | 6 ++++++ src/Facades/Connect.php | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/Facades/Connect.php diff --git a/composer.json b/composer.json index 3b9c9cc..0cef897 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,10 @@ "laravel": { "providers": [ "Bluesquare\\Connect\\ConnectServiceProvider" - ] + ], + "aliases": { + "Connect": "Bluesquare\\Connect\\Facades\\Connect" + } } }, "require": { diff --git a/src/Connect.php b/src/Connect.php index 8d8289d..fd00675 100644 --- a/src/Connect.php +++ b/src/Connect.php @@ -5,6 +5,7 @@ namespace Bluesquare\Connect; use Bluesquare\Connect\Traits\HasConnectSync; use GuzzleHttp\Client; use Illuminate\Http\Request; +use Illuminate\Routing\Router; use Illuminate\Support\Facades\Log; use Illuminate\Support\Str; use Psr\Http\Message\StreamInterface; @@ -359,4 +360,9 @@ class Connect { return config('bconnect.url') ?? 'https://connect.bluesquare.io'; } + + public function routes(Router $router) + { + dump($router); + } } diff --git a/src/Facades/Connect.php b/src/Facades/Connect.php new file mode 100644 index 0000000..5c1d90c --- /dev/null +++ b/src/Facades/Connect.php @@ -0,0 +1,19 @@ +make(\Bluesquare\Connect\Connect::class)->routes( + static::$app->make('router') + ); + } +}