From b11e42f0b9c7289c2870f8a841b44a682f093bd9 Mon Sep 17 00:00:00 2001 From: Julio Motol Date: Mon, 12 Oct 2020 23:01:46 +0800 Subject: [PATCH] Fix Facade --- CHANGELOG.md | 4 ++++ composer.json | 5 ++++- src/Facades/AuthTimeout.php | 2 +- src/ServiceProvider.php | 2 -- tests/TestCase.php | 8 ++++++++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51cb446..f7f9535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v2.2.1 (2020-10-12) + +- Fixed `AuthTimeout` facade. + ## v2.2.0 (2020-10-12) - Added `AuthTimeout` facade. diff --git a/composer.json b/composer.json index e844639..95003d8 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,10 @@ "laravel": { "providers": [ "JulioMotol\\AuthTimeout\\ServiceProvider" - ] + ], + "aliases": { + "AuthTimeout": "JulioMotol\\AuthTimeout\\Facades\\AuthTimeout" + } } } } diff --git a/src/Facades/AuthTimeout.php b/src/Facades/AuthTimeout.php index c335d87..08c8c44 100644 --- a/src/Facades/AuthTimeout.php +++ b/src/Facades/AuthTimeout.php @@ -16,6 +16,6 @@ class AuthTimeout extends Facade { protected static function getFacadeAccessor() { - throw AuthTimeoutContract::class; + return AuthTimeoutContract::class; } } diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 06603d5..643dd35 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -21,7 +21,5 @@ public function register() $this->app->singleton(AuthTimeoutContract::class, function ($app) { return new AuthTimeout($app['auth'], $app['events'], $app['session']); }); - - $this->app->alias(AuthTimeoutContract::class, 'AuthTimeout'); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 9987f6f..b379a87 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,6 +2,7 @@ namespace JulioMotol\AuthTimeout\Tests; +use JulioMotol\AuthTimeout\Facades\AuthTimeout; use JulioMotol\AuthTimeout\ServiceProvider; use Orchestra\Testbench\TestCase as Orchestra; @@ -13,4 +14,11 @@ protected function getPackageProviders($app) ServiceProvider::class, ]; } + + protected function getPackageAliases($app) + { + return [ + 'AuthTimeout' => AuthTimeout::class + ]; + } }