© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
Jakub

Filepond CORS Headers (bunnycdn)

I am fairly confident this is something with CORS headers. I found another thread in here for
waiting for size
waiting for size
and that was the recomended soluiton, but did not really provide much context for what this is .

First, file uploads all work, and I do see them in the correct directly on bunnycdn when I login. The only thing I am having an issue with is this preview image when I am on the view or edit pages.

.env
APP_URL=http://breezypixels-website.test

BUNNYCDN_STORAGE_ZONE="breezy-pixels"
BUNNYCDN_API_KEY="API Key"
BUNNYCDN_BASE_URL="https://breezy.b-cdn.net/"
BUNNYCDN_REGION=la

FILAMENT_FILESYSTEM_DISK=bunnycdn
APP_URL=http://breezypixels-website.test

BUNNYCDN_STORAGE_ZONE="breezy-pixels"
BUNNYCDN_API_KEY="API Key"
BUNNYCDN_BASE_URL="https://breezy.b-cdn.net/"
BUNNYCDN_REGION=la

FILAMENT_FILESYSTEM_DISK=bunnycdn


filesystems.php
        'bunnycdn' => [
            'driver' => 'bunnycdn',
            'api_key' => env('BUNNYCDN_API_KEY'),
            'storage_zone' => env('BUNNYCDN_STORAGE_ZONE'),
            'base_url' => env('BUNNYCDN_BASE_URL'),
        ],
        'bunnycdn' => [
            'driver' => 'bunnycdn',
            'api_key' => env('BUNNYCDN_API_KEY'),
            'storage_zone' => env('BUNNYCDN_STORAGE_ZONE'),
            'base_url' => env('BUNNYCDN_BASE_URL'),
        ],


AppServiceProvider.php
        Storage::extend('bunnycdn', function ($app, $config) {
            $adapter = new BunnyCDNAdapter(
                new BunnyCDNClient(
                    $config['storage_zone'],
                    $config['api_key'],
                    $config['region'] ?? 'default_region'
                ),
                $config['base_url']
            );

            return new FilesystemAdapter(
                new Filesystem($adapter, $config),
                $adapter,
                $config
            );
        });
        Storage::extend('bunnycdn', function ($app, $config) {
            $adapter = new BunnyCDNAdapter(
                new BunnyCDNClient(
                    $config['storage_zone'],
                    $config['api_key'],
                    $config['region'] ?? 'default_region'
                ),
                $config['base_url']
            );

            return new FilesystemAdapter(
                new Filesystem($adapter, $config),
                $adapter,
                $config
            );
        });


PortfolioResource.php form
 Forms\Components\FileUpload::make('image_path')
                            ->disk('bunnycdn')
                            ->directory('breezy-pixels-website')
                            ->visibility('public')
                            ->label('Dribble Shot'),
 Forms\Components\FileUpload::make('image_path')
                            ->disk('bunnycdn')
                            ->directory('breezy-pixels-website')
                            ->visibility('public')
                            ->label('Dribble Shot'),



I thought maybe it was bc its not https, but when i got it working on a live website. Having the same perpetual loading
c331a64b80bc51a59e38b9f56e3cb548.png
Solution
280d62a8df873fff8c6c5a8ba89cdf46.png
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

CORS Filepond fileupload
FilamentFFilament / ❓┊help
7mo ago
Filepond Issue
FilamentFFilament / ❓┊help
10mo ago
Filepond overflow
FilamentFFilament / ❓┊help
17mo ago
Overriding Filepond labels
FilamentFFilament / ❓┊help
13mo ago