I am storing files at local storage. So, in /storage/app/public
directory.
I am storing my files in /storage/app/public/userId/images
;
I used php artisan storage:link
, so I can access that files in view, having a shortcut to this folder in /public/storage/userId/images
Inside that path I have 2 images - test.jpg
and test2.jpg
I can't find a response at Laravel documentation, how to delete file test.jpg
from /public/storage/userId/images
I tried in this way :
$path = 'public/' . $id . '/diploma';
$files = Storage::files($path);
return $files;
It returns me :
[
"public/303030/images/test.jpg"
"public/303030/images/test2.jpg"
]
Now, how can I call Storage::delete('test.jpg')
on that array?