public function index() { $folderPath=public_path('test'); $dd =File::deleteDirectory($folderPath); dd($dd); }More information: https://www.educba.com/laravel-delete-file/