NDO
NDO
FFilament
Created by NDO on 2/15/2024 in #❓┊help
ImageColumn default url for stacked columns
Hey 👋 I am trying to create a stacked image column for related model (users). Because user model image is not required I want to set default image url with method that returns full url of user avatar if his img_path field is empty. I tried with code below but it is not working because the method defaultImageUrl should return the string and not the array value. Does anyone know how I can set default image url for the stacked ImageColumn? Tables\Columns\ImageColumn::make('users.img_path') ->label('Peoples') ->circular() ->stacked() ->limit() ->limitedRemainingText() ->defaultImageUrl(function ($record) { $images=[]; foreach($record->users as $user) { $images[] = $user->getImageUrl(); } return $images; }),
14 replies
FFilament
Created by NDO on 8/28/2023 in #❓┊help
RichEditor field unfocus on value change
Hi guys 👋 I am trying to use RichEditor field for comment body inside my RelationManager form. But it unfocus me from the field on each keyup event inside the mentioned RichEditor. Does any of you know how to avoid this behaivor?
public function form(Form $form): Form
{
return $form
->schema([
RichEditor::make('body')
->disableToolbarButtons([
'attachFiles',
'codeBlock',
])
->hiddenLabel()
->rules(['required', 'string']),
]);
}
public function form(Form $form): Form
{
return $form
->schema([
RichEditor::make('body')
->disableToolbarButtons([
'attachFiles',
'codeBlock',
])
->hiddenLabel()
->rules(['required', 'string']),
]);
}
2 replies