i have image file in C:\xampp\htdocs\blog\storage\app\public\images\15201710351.jpg
and i am trying to delete it from images folder with Storage
class
$post = Post::find($id);
Storage::delete(storage_path().'app/public/images/'.$post->image);
and with
Storage::delete(storage_path('app/public/images/'.$post->image));
also with this
Storage::delete(public_path().'/storage/images/'.$post->image);// i have created symbolic link
there is no error message, but it is not working. i am using laravel 5.6, anyone can help?
The default public storage location is storage/app/public
, so just pass in the images directory and filename like so:
Storage::delete('images/' . $post->image)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With