Skip to content

Commit

Permalink
Add support for Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
alajusticia committed Feb 28, 2024
1 parent 9427a23 commit 9dd46a2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 10 additions & 11 deletions config/expirable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
];
12 changes: 7 additions & 5 deletions src/ExpirableServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ public function register()
$this->mergeConfigFrom(
__DIR__.'/../config/expirable.php', 'expirable'
);

// Register commands
$this->commands([
Commands\PurgeCommand::class,
]);
}

/**
Expand All @@ -40,5 +35,12 @@ public function boot()

// Register macros
Blueprint::mixin(new BlueprintMacros);

if ($this->app->runningInConsole()) {
// Register commands
$this->commands([
Commands\PurgeCommand::class,
]);
}
}
}

0 comments on commit 9dd46a2

Please sign in to comment.