ilhamzacky
1 week ago

laravel delete a file from google cloud storage

Posted 1 week ago by ilhamzacky

Hi all, I am uploading some files to google cloud using this code

	$disk = \Storage::disk('gcs');
        $disk_local = Storage::disk('public');
        $directory = "uploads/files/screening/";

        $file_name = $this->asset->name;
        $file = new files($disk_local->path($directory . $file_name));
        $res = $disk->putFileAs('files/screening/', $file, $file_name);

       $this->updateAssetIsSynced($file_name);

       UploadableAsset::where('name', $file_name)
            ->update(['is_uploaded' => TRUE]);

Can someone help me to delete a certain file from google cloud storage. any suggestions?

THAK YOU

Please sign in or create an account to participate in this conversation.