put('test-backup/backup1.zip', 'content'); // Create an orphaned DB record Backup::create([ 'file_name' => 'test-backup backup2.zip', 'disk' => 'test-disk', 'path' => 'test-backup/backup2.zip', 'size' => 1024, 'type' => 'full', ]); $action = new SyncBackupCatalog(); $action->execute(); $this->assertDatabaseHas('backups', ['file_name' => 'test-backup backup1.zip']); $this->assertDatabaseMissing('backups', ['file_name' => 'test-backup backup2.zip']); } }