Cloudinary FileUpload Integration

I'm new in Filament, either in Laravel. I want to integrate FileUpload component with Cloudinary. I want user can upload image on the component, and its gonna store on database.

I'm using this package of Cloudinary Laravel:
https://github.com/cloudinary-community/cloudinary-laravel

My form schema is
FileUpload::make('cover_art')
 ->disk('cloudinary')


and have this function on model
public function store(Request $request)
{
    $uploadedFile = $request->file('cover_art');

    if ($uploadedFile) {
        $result = $uploadedFile->storeOnCloudinary();

        $url = $result->getSecurePath();
        return response()->json([
            'url' => $url,
            'size' => $result->getSize(),
            'fileType' => $result->getFileType(),
            'fileName' => $result->getFileName(),
            'originalFileName' => $result->getOriginalFileName(),
            'publicId' => $result->getPublicId(),
            'extension' => $result->getExtension(),
            'width' => $result->getWidth(),
            'height' => $result->getHeight(),
            'timeUploaded' => $result->getTimeUploaded(),
        ]);
    }

    return response()->json(['error' => 'No file uploaded'], 400);
}


and when I run it, it's got
The GET method is not supported for route livewire/upload-file. Supported methods: POST.
on console, and
PHP Fatal error:  Trait "League\Flysystem\Adapter\Polyfill\NotSupportingVisibilityTrait" not found in C:\Users\rizky\soundmera\vendor\cloudinary-labs\cloudinary-laravel\src\CloudinaryAdapter.php on line 16
on terminal

Is there any mistake? I'm very confused. Or maybe anyone have some article/video about this?

Thanks
GitHub
Laravel SDK for Cloudinary. Contribute to cloudinary-community/cloudinary-laravel development by creating an account on GitHub.
Was this page helpful?