diff --git a/README.md b/README.md index 4f165ab..6ba8916 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ When the expiration date is reached, the model will automatically disappear from | Laravel Expirable package version | Supported Laravel framework versions | |----------------------------------------------------------------|--------------------------------------| -| v2 | 10 | +| v2 | 10 and 11 | | [v1](https://github.com/alajusticia/laravel-expirable/tree/v1) | 5.8 to 9 | You're reading the documentation for the latest version (v2) of this package. diff --git a/composer.json b/composer.json index 133e7c9..22ce23c 100644 --- a/composer.json +++ b/composer.json @@ -12,10 +12,10 @@ ], "require": { "php": "^8.1", - "illuminate/console": "^10.0", - "illuminate/database": "^10.0", - "illuminate/support": "^10.0", - "nesbot/carbon": "^2.62.1" + "illuminate/console": "^10.0|^11.0", + "illuminate/database": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "nesbot/carbon": "^2.67|^3.0" }, "require-dev": { "mockery/mockery": "^1.5", diff --git a/config/expirable.php b/config/expirable.php index 16ff387..adc927c 100644 --- a/config/expirable.php +++ b/config/expirable.php @@ -15,17 +15,6 @@ 'attribute_name' => 'expires_at', - /* - |-------------------------------------------------------------------------- - | Mode - |-------------------------------------------------------------------------- - | - | Whether the expirable:purge command deletion defaults to hard or soft. - | Defaults to hard for backward compatibility. - | - */ - 'mode' => 'hard', - /* |-------------------------------------------------------------------------- | Purge @@ -39,4 +28,14 @@ 'purge' => [], + /* + |-------------------------------------------------------------------------- + | Purge Mode + |-------------------------------------------------------------------------- + | + | Whether the expirable:purge command deletion defaults to hard or soft. + | Defaults to hard for backward compatibility. + | + */ + 'mode' => 'hard', ]; diff --git a/src/ExpirableServiceProvider.php b/src/ExpirableServiceProvider.php index 178dbf3..8535090 100644 --- a/src/ExpirableServiceProvider.php +++ b/src/ExpirableServiceProvider.php @@ -19,11 +19,6 @@ public function register() $this->mergeConfigFrom( __DIR__.'/../config/expirable.php', 'expirable' ); - - // Register commands - $this->commands([ - Commands\PurgeCommand::class, - ]); } /** @@ -40,5 +35,12 @@ public function boot() // Register macros Blueprint::mixin(new BlueprintMacros); + + if ($this->app->runningInConsole()) { + // Register commands + $this->commands([ + Commands\PurgeCommand::class, + ]); + } } }