BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
www
/
app.imagivibe.com
/
vendor
/
laravel
/
octane
/
src
/
Listeners
📤 Upload
📝 New File
📁 New Folder
Close
Editing: FlushUploadedFiles.php
<?php namespace Laravel\Octane\Listeners; use Illuminate\Support\Arr; use SplFileInfo; class FlushUploadedFiles { /** * Handle the event. * * @param mixed $event */ public function handle($event): void { foreach ($event->request->files->all() as $files) { foreach (Arr::wrap($files) as $file) { if (! $file instanceof SplFileInfo || ! is_string($path = $file->getRealPath())) { continue; } clearstatcache(true, $path); if (is_file($path)) { unlink($path); } } } } }
Save
Cancel