ekrbodo
RichEditor S3 private visibility
If you are uploading attatchments with RichEditor and are using private visbility, the whole url, including the expire signature is included in the url. This will cause the url-link to expire after a while. I guess this is a bug, but i haven´t debuged the Filament intrnals.
Form input example:
RichEditor::make('description')
->label('Beskrivelse')
->columnSpanFull()
->fileAttachmentsDisk('s3')
->fileAttachmentsDirectory(Filament::getTenant()->id . '/' . 'tasks')
->fileAttachmentsVisibility('private'),
Url stored in the text-field:
https://yourS3path.amazonaws.com/path/sub-path/filename.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=randomnumnber%2Feu-north-1%2Fs3%2Faws4_request&X-Amz-Date=20240705T135351Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=randomsignature
Is there any workaround to get this working, or should it be reported as a bug?11 replies
Struggling with pluck
I have a table action row, which opens a modal. I´m able to access the $record, and when i do a dd on the $record, only the row-record is present. However, if i use the pluck method, it gives me the all the records on that model:
Gives me an unexpected result:
dd($record->pluck('name', 'id'))
Illuminate\Support\Collection {#2420 ▼ // app/Filament/Resources/CustomerResource.php:261
#items: array:3 [▼
1 => "Demobedriften"
2 => "Datterselskap"
3 => "Test testensen"
]
#escapeWhenCastingToString: false
}
Works as expected:
Forms\Components\TextInput::make('test')->default(fn ($record) => dd(($record->name)),
"Demobedriften" // app/Filament/Resources/CustomerResource.php:261
As i understand the documentation, i should be able to use the pluck method and only pluck fields from the selected row record. Is this by design or a bug? Is there other ways to pluck valus form a single row-record?5 replies
IconColumn enum
I´m trying to use a IconColumn on a field which is casting a Enum. I´m getting this error:
App\Filament\Resources\QualityResource::App\Filament\Resources{closure}(): Argument #1 ($state) must be of type string, App\Enum\QualityType given
Is there another way to get this working?
Code-example
use Filament\Tables\Columns\IconColumn;
IconColumn::make('type')
->icon(fn (string $state): string => match ($state) {
'draft' => 'heroicon-o-pencil',
'reviewing' => 'heroicon-o-clock',
'published' => 'heroicon-o-check-circle',
})
3 replies