Skip to content

Commit

Permalink
Keep only last 4 database backups
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 12, 2024
1 parent f2fdcdf commit 3e973f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Console/Commands/PerformDatabaseBackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle(): void

$glob = File::glob(database_path('backups/*.sql'));

collect($glob)->sort()->reverse()->slice(20)->each(
collect($glob)->sort()->reverse()->slice(4)->each(
fn (string $backup): bool => File::delete($backup),
);
}
Expand Down

0 comments on commit 3e973f8

Please sign in to comment.