How to Access image in filament if I want to modify that .

How to Access image in filament if I want to modify that like I am trying to upload image on BunnyCDN and CDN's path want to update in DB, I dont want to upload image in local disk I created disk in FileSystem.php
'bunnycdn' => [
'driver' => 'bunnycdn',
'storage_zone' => env('BUNNYCDN_STORAGE_ZONE'),
'api_key' => env('BUNNYCDN_APY_KEY'),
'region' => env('BUNNYCDN_REGION'),
'public_url'=>env('BUNNY_PUBLIC_URL')
],
'bunnycdn' => [
'driver' => 'bunnycdn',
'storage_zone' => env('BUNNYCDN_STORAGE_ZONE'),
'api_key' => env('BUNNYCDN_APY_KEY'),
'region' => env('BUNNYCDN_REGION'),
'public_url'=>env('BUNNY_PUBLIC_URL')
],
AppServicePRovider
public function boot(): void
{
Storage::extend('bunnycdn', function ($app, $config) {
$adapter = new BunnyCDNAdapter(
new BunnyCDNClient(
$config['storage_zone'],
$config['api_key'],
$config['region']
),
'https://ape-stegback-tj.b-cdn.net/development' # Optional
);

return new FilesystemAdapter(
new Filesystem($adapter, $config),
$adapter,
$config
);
});
}
public function boot(): void
{
Storage::extend('bunnycdn', function ($app, $config) {
$adapter = new BunnyCDNAdapter(
new BunnyCDNClient(
$config['storage_zone'],
$config['api_key'],
$config['region']
),
'https://ape-stegback-tj.b-cdn.net/development' # Optional
);

return new FilesystemAdapter(
new Filesystem($adapter, $config),
$adapter,
$config
);
});
}
CreateRecord
public function mutateFormDataBeforeCreate($data): array
{
if (request()->hasFile('phone')) {
$phoneFile = request()->file('phone');
$fileName = $phoneFile->hashName();
$filePath = "eppsolar/slider/{$fileName}";
dd($filePath);
Storage::disk('bunnycdn')->put($filePath, file_get_contents($phoneFile));
$data['phone'] = Storage::disk('bunnycdn')->url($filePath);
}
}
public function mutateFormDataBeforeCreate($data): array
{
if (request()->hasFile('phone')) {
$phoneFile = request()->file('phone');
$fileName = $phoneFile->hashName();
$filePath = "eppsolar/slider/{$fileName}";
dd($filePath);
Storage::disk('bunnycdn')->put($filePath, file_get_contents($phoneFile));
$data['phone'] = Storage::disk('bunnycdn')->url($filePath);
}
}
4 Replies
toeknee
toeknee2mo ago
Laravel
File Uploads | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
kartikey_maandothiya
I am not uploading on livewire. I am uploading via Filament Admin Panel
toeknee
toeknee2mo ago
And what does Filament Admin Panel Use.....
kartikey_maandothiya
obviously I know but the document you shared is only work with default functionality on livewire and filamnet work differently and its data processing functionality is also different , and the core function of filament muteFormDataBeforeSave here we modify the data and I want to upload images from here to bunnyCDN Also I used the Disk() but its not working check my code flow.
Want results from more Discord servers?
Add your server
More Posts
Calling $wire.$id inside custom form element returns the whole form ID and not only the element.I am trying to use `$wire.$call('myFunction')` from inside a custom form component, but I get `UnablResource vs Page for Stock Management & Reporting?Hi there, I am quite new to Filament and now have to build a Stock Management & Reporting view for mIs there anyway to reload RelationManager Owner page with Spa mode?In my CreateAction of the RelationManager, I have update some ower model data, I then want it to refIssues with scrolling relationship manager modal on IOS DevicesHi everyone, Hoping someone has had this issue as well 🙂 I've followed the pre-issue report guidemultiple() select not work with afterStateUpdatedgenerate attribute values based on the selected attributes and add them into the repeaterAnimation On Action Buttonhi all , i have a question . is that possible to add animation trigger on action button ? example liEasy way to only allow registration and login via Socialite?I am looking for a way to disable login and only show a login or register button with Google/Github/Form in Livewire: Disable Submit-Button, while a file uploads?Hi, im using the Filament Form inside a Livewire component. While **uploading a large file**, the Help, Setting runtime config only for one FileUploadHi firends, Here I have a **FileUpload** that is setupped to work with **S3 pre-signed links** and My issue : After perform delete its not applaying redirectsWhen deleteign a record that uses HasRelationManagers on Edit record page it tells me Call to a mem