Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel delete file from storage

<?php
  
namespace AppHttpControllers;
  
use IlluminateHttpRequest;
use File;
  
class DemoController extends Controller
{
    /**
     * Write code on Construct
     *
     * @return IlluminateHttpResponse
     */  
    public function removeImage(Request $request)
    {
        if(File::exists(public_path('upload/test.png'))){
            File::delete(public_path('upload/test.png'));
        }else{
            dd('File does not exists.');
        }
    }
}
Source by www.itsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #laravel #delete #file #storage
ADD COMMENT
Topic
Name
4+4 =