ghostrockz3d
ghostrockz3d
FFilament
Created by GeRaged | Niklas on 9/13/2023 in #❓┊help
Installing filepond plugin for file upload
Hi Have you found any solution for loading custom/installed filepond plugins ?
6 replies
FFilament
Created by ghostrockz3d on 8/29/2023 in #❓┊help
Updated to V3 Aside flashes on route change
Couldn't find anything is this a normal behaviour ? Also css / js are being cached so it's not downloading it everytime
6 replies
FFilament
Created by ghostrockz3d on 7/15/2023 in #❓┊help
Spatie media library not Saving on S3
Thanks G
3 replies
FFilament
Created by ghostrockz3d on 6/28/2023 in #❓┊help
File Upload
$image = Image::create([
'provider_id' => $file['fileId'],
'imagable_type' => 'Narrator',
'imagable_id' => $record->id,
'width' => $file['width'],
'height' => $file['height'],
'url' => $file['url'],
]);

if ($record->image_id) {
$oldImage = Image::find($record->image_id);
ImageKitFacade::deleteById($oldImage->provider_id);
$oldImage->delete();
}

$record->update(['image_id' => $image->id]);
}),
$image = Image::create([
'provider_id' => $file['fileId'],
'imagable_type' => 'Narrator',
'imagable_id' => $record->id,
'width' => $file['width'],
'height' => $file['height'],
'url' => $file['url'],
]);

if ($record->image_id) {
$oldImage = Image::find($record->image_id);
ImageKitFacade::deleteById($oldImage->provider_id);
$oldImage->delete();
}

$record->update(['image_id' => $image->id]);
}),
21 replies
FFilament
Created by ghostrockz3d on 6/28/2023 in #❓┊help
File Upload
Forms\Components\FileUpload::make('image')
->image()
->visibleOn('edit')
->getUploadedFileNameForStorageUsing(static function (TemporaryUploadedFile $file): string {
return Str::random(32);
})
->saveUploadedFileUsing(static function (FileUpload $component, TemporaryUploadedFile $file, Narrator $record) {
$temporarilyFilename = $file->getFilename();
$basePath = 'narrators';
$tempUploadFolderName = config('livewire.temporary_file_upload.directory');
$extension = substr($temporarilyFilename, strrpos($temporarilyFilename, '.'));
$newFilename = $component->getUploadedFileNameForStorage($file).$extension;

Storage::move("$tempUploadFolderName/$temporarilyFilename", $basePath);
Storage::move("$basePath/$temporarilyFilename", $newFilename);
$file = ImageKitFacade::searchFile("$basePath/$newFilename");
Forms\Components\FileUpload::make('image')
->image()
->visibleOn('edit')
->getUploadedFileNameForStorageUsing(static function (TemporaryUploadedFile $file): string {
return Str::random(32);
})
->saveUploadedFileUsing(static function (FileUpload $component, TemporaryUploadedFile $file, Narrator $record) {
$temporarilyFilename = $file->getFilename();
$basePath = 'narrators';
$tempUploadFolderName = config('livewire.temporary_file_upload.directory');
$extension = substr($temporarilyFilename, strrpos($temporarilyFilename, '.'));
$newFilename = $component->getUploadedFileNameForStorage($file).$extension;

Storage::move("$tempUploadFolderName/$temporarilyFilename", $basePath);
Storage::move("$basePath/$temporarilyFilename", $newFilename);
$file = ImageKitFacade::searchFile("$basePath/$newFilename");
21 replies
FFilament
Created by ghostrockz3d on 6/28/2023 in #❓┊help
File Upload
The thing is the main backend is js but because laravel has a rich community especially filament We appreciate the work you guys put on filament I don't think there's an admin panel that comes near filament it terms of customization even admin js That's why we have a images model that looks like this id imagable_type Imgable_id provider_id url width height and users model looks like this id image_id ( points to images ) etc ... The main question is how to show the image.url in file upload ? Thank you for your support
21 replies
FFilament
Created by ghostrockz3d on 6/28/2023 in #❓┊help
File Upload
is it loadStateFromRelationships() ?
21 replies
FFilament
Created by ghostrockz3d on 6/28/2023 in #❓┊help
File Upload
We have a model called Images that is morph Right now i'm confused which method to call ?
21 replies
FFilament
Created by ghostrockz3d on 6/28/2023 in #❓┊help
File Upload
Thanks you for the recommendation It seems the team found a way to upload it like a charm Right now the file get uploaded successfuly and we can show the image on the table but how can we show it in the FileUpload ? Is there a method that gets an url and shows the previous uploaded image preivew ?
21 replies
FFilament
Created by ghostrockz3d on 6/28/2023 in #❓┊help
File Upload
Do you have any alternatives that we can use / a work around / package ?
21 replies