diff --git a/app/Traits/Sofascore/GrappingSofascore.php b/app/Traits/Sofascore/GrappingSofascore.php index aaeca454..28ea1bab 100644 --- a/app/Traits/Sofascore/GrappingSofascore.php +++ b/app/Traits/Sofascore/GrappingSofascore.php @@ -252,8 +252,10 @@ trait GrappingSofascore $this->restart = 1; break; case 'clear': - $this->restart = 1; - $this->clear_folder($folder, 'all'); + if ($this->confirm_delete() == 'Yes') { + $this->restart = 1; + $this->clear_folder($folder, 'all'); + } break; } @@ -432,4 +434,16 @@ trait GrappingSofascore ] ); } + + protected function confirm_delete(): string + { + return select( + label: 'Confirm delete!', + default: 'no', + options: [ + 'no' => 'No', + 'yes' => 'Yes', + ] + ); + } }