backstage/filament-uploadcare-field
Integrates Uploadcare into Filament forms for Laravel apps. This package provides a ready-made form field that lets users upload, select, and manage Uploadcare files and images inside your admin panels, saving you from writing custom components and upload logic.
Use this package when you want Filament form uploads to go directly to Uploadcare while Laravel stores only a reference. Treat it as a Filament form-field adapter, not a complete digital asset management layer.
Minimal steps:
composer require backstage/filament-uploadcare-field.composer.json for the supported Filament version. This is important because Filament v3 and v4 form APIs differ..env/config as documented. Only put the secret key server-side if you are also doing server-side Uploadcare API calls.php artisan filament:assets if the package ships Filament assets.Look first at:
README.md for install/config and exact component namespace.src/ for the component class and supported methods.resources/ for JS/widget initialization.backstage/cms for real-world usage, because this repository is a READ ONLY subtree split.First use case: replace a normal Filament FileUpload with an Uploadcare-backed image field on a Resource form.
use Backstage\FilamentUploadcareField\Forms\Components\UploadcareFileUpload;
UploadcareFileUpload::make('cover_image')
->label('Cover image')
->required();
Add a cover_image column to the model/table, make it fillable, and render it through an accessor or CDN URL helper.
Basic single-file field
public static function form(Schema $schema): Schema
{
return $schema->components([
UploadcareFileUpload::make('cover_image')
->label('Cover image')
->required()
->helperText('Uploaded to Uploadcare; only a reference is stored locally.'),
]);
}
Adjust the method signature for Filament v3 vs v4.
Normalize what you store
Confirm whether the component stores an Uploadcare UUID, a full CDN URL, or a file group. Pick one convention and stick to it. UUIDs are usually better because you can generate CDN transformations later without rewriting stored data.
// app/Models/Post.php
use Illuminate\Database\Eloquent\Casts\Attribute;
protected function coverUrl(): Attribute
{
return Attribute::get(fn () => $this->cover_image
? "https://ucarecdn.com/{$this->cover_image}/"
: null);
}
Render in tables and infolists
If you store UUIDs, build the CDN URL in an accessor or column state callback. Do not make every view know Uploadcare URL structure.
ImageColumn::make('cover_url')
->label('Cover')
->getStateUsing(fn ($record) => $record->cover_url);
Use Uploadcare transformations instead of storing variants
Store the source reference and generate display variants at render time:
$thumb = "https://ucarecdn.com/{$uuid}/-/resize/400x/";
$webp = "https://ucarecdn.com/{$uuid}/-/format/webp/";
This keeps the database clean and lets you change image sizes later.
Multiple files
Only use ->multiple() if the component actually supports it. If it does, store a JSON array and cast it:
protected $casts = [
'gallery' => 'array',
];
Validate that every value is a UUID or expected URL shape. Test repeaters and Builder blocks carefully because custom JS widgets often need stable wire:key values.
Validation
Use Filament validation where available, plus Uploadcare-side restrictions for accepted file types and size. Because the file may already be uploaded to Uploadcare before Laravel sees it, server-side MIME/size validation may need Uploadcare metadata rather than a normal Laravel uploaded-file rule.
UploadcareFileUpload::make('cover_image')
->required()
->rules(['string']);
Cleanup
Deleting a model record will not automatically delete the Uploadcare file. If orphan files matter, add a model observer/job that calls the Uploadcare API, or schedule periodic orphan cleanup. Otherwise document that Uploadcare remains the source of truth.
Testing
Do not drive the real Uploadcare widget in feature tests. Set model attributes directly or fake the upload response. Assert that the form exposes the field, that values are stored in the expected format, and that rendering uses the accessor/CDN URL.
backstage/cms. Do not expect fixes to land here directly.wire:key values and test those contexts explicitly.php artisan config:clear or php artisan optimize:clear, then re-cache if needed.php artisan filament:assets has been run.How can I help you explore Laravel packages today?