Skip to content

backstagephp/uploadcare-field

Repository files navigation

Uploadcare Field component for the Backstage CMS.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Nice to meet you, we're Vormkracht10

Hi! We are a web development agency from Nijmegen in the Netherlands and we use Laravel for everything: advanced websites with a lot of bells and whitles and large web applications.

About this package

This package adds an Uploadcare field to the Backstage CMS. Uploadcare is a powerful file handling platform that provides file uploads, storage, transformations and delivery. With this package, you can easily integrate Uploadcare's functionality into your Backstage CMS forms.

The field supports:

  • Single and multiple file uploads
  • Image previews
  • File size limits
  • Allowed file types
  • Direct CDN delivery
  • Image transformations
  • Secure file storage

Once installed, you can use the Uploadcare field in your Backstage forms just like any other field type, while leveraging Uploadcare's robust file handling capabilities.

Other custom fields

For a list of other custom fields, please see the Backstage CMS documentation.

Installation

You can install the package via composer:

composer require backstage/uploadcare-field

Then you need to add the Uploadcare public key to your services.php config file:

return [
    'uploadcare' => [
        'public_key' => env('UPLOADCARE_PUBLIC_KEY')
    ]
];

Then you need to add the Uploadcare field to your backstage/fields.php config file:

return [

    // ...

    'custom_fields' => [
        Backstage\UploadcareField\Uploadcare::class,
    ],
];

Automatic Migration

This package includes an automatic migration that fixes double-encoded JSON data in Uploadcare fields. This migration runs automatically when the package is installed or updated.

What the migration does:

  • Fixes double-encoded JSON: Removes unnecessary JSON encoding layers that were created in earlier versions
  • Updates both tables: Processes both content_field_values and settings tables
  • Safe execution: Only runs if the relevant tables exist
  • Logging: Logs all changes for transparency and debugging

The migration will run automatically when you:

  • Install the package for the first time
  • Update the package via Composer
  • Run composer update or composer install

⚠️ Important: This migration is not reversible. Always make a database backup before updating the package.

Usage

After adding the Uploadcare field to your backstage/fields.php config file, the field will automatically be available in the Backstage CMS.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Backstage Uploadcare Field

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 5

Languages