F
Filament4mo ago
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 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
No description
4 Replies
Jakub
Jakub4mo ago
I am probably missing something super obvious here, but this is my 2nd day on this haha chat gpt was no help either 😦 Resolved!
Solution
Jakub
Jakub4mo ago
No description
Jakub
Jakub4mo ago
Had to login on bunndy cdn and just add png and jpg
Jakub
Jakub4mo ago
No description
Want results from more Discord servers?
Add your server
More Posts