Skip to content

Commit

Permalink
Merge pull request #62 from ryanldy/feat/allow-disabling-of-scheduled…
Browse files Browse the repository at this point in the history
…-prune

Allow disabling of scheduled prune
  • Loading branch information
marcogermani87 authored May 27, 2024
2 parents 6f9ea7b + 73c3463 commit 3249d0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ return [
'keep_email_for_days' => 60,
'label' => null,

'prune_enabled' => true,
'prune_crontab' => '0 0 * * *',

'can_access' => [
Expand Down
1 change: 1 addition & 0 deletions config/filament-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'keep_email_for_days' => 60,
'label' => null,

'prune_enabled' => true,
'prune_crontab' => '0 0 * * *',

'can_access' => [
Expand Down
4 changes: 4 additions & 0 deletions src/FilamentEmailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public function configurePackage(Package $package): void

public function bootingPackage()
{
if(! config('filament-email.prune_enabled')) {
return;
}

$this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
$runCrontab = config('filament-email.prune_crontab', '0 0 * * *');
$modelClass = config('filament-email.resource.model') ?? Email::class;
Expand Down

0 comments on commit 3249d0c

Please sign in to comment.