diff --git a/README.md b/README.md index 30914f5..fc4b036 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ composer require appwilio/russianpost-sdk ``` При использовании фреймворка [Laravel](https://laravel.com/) SDK автоматически регистрирует доступные сервисы. +> Минимальная версия Laravel — 5.8. ## Логирование diff --git a/composer.json b/composer.json index 7f6d345..d1c407d 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,8 @@ "psr/log": "^1.1" }, "require-dev": { - "illuminate/support": "5.1 - 5.8", - "monolog/monolog": "^1.25", + "illuminate/support": "^5.8|^6.0|^7.0", + "monolog/monolog": "^1.25|^2.0", "phpunit/phpunit": "^7.5", "symfony/var-dumper": "^4.3" }, diff --git a/src/LaravelServiceProvider.php b/src/LaravelServiceProvider.php index e9943b0..8f6f0df 100644 --- a/src/LaravelServiceProvider.php +++ b/src/LaravelServiceProvider.php @@ -17,15 +17,14 @@ use GuzzleHttp\Client as GuzzleClient; use Illuminate\Support\ServiceProvider; use Illuminate\Contracts\Container\Container; +use Illuminate\Contracts\Support\DeferrableProvider; use Appwilio\RussianPostSDK\Tracking\PacketAccessClient; use Appwilio\RussianPostSDK\Tracking\SingleAccessClient; use Appwilio\RussianPostSDK\Dispatching\DispatchingClient; -class LaravelServiceProvider extends ServiceProvider +class LaravelServiceProvider extends ServiceProvider implements DeferrableProvider { - protected $defer = true; - - public function register() + public function register(): void { $this->app->singleton(SingleAccessClient::class, function (Container $app) { $config = $app['config']['services.russianpost.tracking'];