@phil_dr I'm not familiar this Cloudinary platform, but skimming over their documentation, it seems clear that you can't delete a folder until its empty. You would either need to get a list of all the assets, and then provide an array of ids (up to 100) to delete using the deleteAssets() method. If you have more than 100 files, you'll need to make multiple calls. Otherwise, it looks like you might be able to pass the all option to delete all contents within the folder. You can read about it here:
https://cloudinary.com/documentation/admin_api#delete_folder https://cloudinary.com/documentation/admin_api#delete_resources
As for your error:
Call to undefined method CloudinaryLabs\CloudinaryLaravel\CloudinaryEngine::deleteAssetsByPrefix()
This is likely because they haven't included that within the Laravel package, which looks to be just a wrapper for the Cloudinary PHP SDK. You could always access that underlying package directly to make that call.
You may also check out this resource:
That above link looks to be for their legacy 1.0 version. You would want to use deleteAllAssets() for v2.0. But it gives you the idea..