lundi 27 juillet 2020

How to delete folder (and its content) not under storage/app in Laravel?

I know we can use Storage::delete() or File::delete to delete folders and/or files in laravel, but this seems not working for folders directly under storage, I mean storage/tmp by example. It only works for storage/app. How to deal with this?

if (file_exists( storage_path() . '/tmp/file1'.'.pdf' )) {
     File::delete(storage_path() . '/tmp/file1'.'.pdf') );
}

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire