Lars van Herwijnen
Lars van Herwijnen
FFilament
Created by Lars van Herwijnen on 5/27/2024 in #❓┊help
Notification not working
No description
18 replies
FFilament
Created by Lars van Herwijnen on 5/14/2024 in #❓┊help
Placeholders in Richeditor.
Is it possible to add a drop with list of placeholders? I want to use this for editing email templates where I want to provide the user with dynamic data (order number, user name, ect).
3 replies
FFilament
Created by Lars van Herwijnen on 4/2/2024 in #❓┊help
Text overflow ellipsis
No description
11 replies
FFilament
Created by Lars van Herwijnen on 3/5/2024 in #❓┊help
Update hidden fields (Relationship)
So I have a select input that is a relation. This field is hidden or shown based on the type of the user. But when type is changed to Customer the relation, the select, should be updated. I know that the field is not being updated because it is hidden. Is their away around this?
return $form
->schema([
Forms\Components\Group::make()->schema([
Forms\Components\Section::make()->schema([
Forms\Components\TextInput::make('name')
->label('Name')
->required()
->placeholder('John Doe')
->maxLength(255)
->columns(2),
Forms\Components\TextInput::make('email')
->label('Email')
->required()
->columns(2),
Forms\Components\Select::make('type')
->label('Type')
->options(UserRoles::toArray())
->afterStateUpdated(function (Get $get, Set $set) {
if ($get('type') == UserRoles::CUSTOMER->value) {
$set('groups', null);
}

})
->live()
->required(),
Forms\Components\Select::make('groups')
->relationship('groups')
->label('Groups')
->options(Group::all()->pluck('name', 'id'))
->multiple()
->required()
->hidden(fn(Get $get) => $get('type') == UserRoles::CUSTOMER->value),
])->columns(2),
])->columnSpanFull(),
]);

return $form
->schema([
Forms\Components\Group::make()->schema([
Forms\Components\Section::make()->schema([
Forms\Components\TextInput::make('name')
->label('Name')
->required()
->placeholder('John Doe')
->maxLength(255)
->columns(2),
Forms\Components\TextInput::make('email')
->label('Email')
->required()
->columns(2),
Forms\Components\Select::make('type')
->label('Type')
->options(UserRoles::toArray())
->afterStateUpdated(function (Get $get, Set $set) {
if ($get('type') == UserRoles::CUSTOMER->value) {
$set('groups', null);
}

})
->live()
->required(),
Forms\Components\Select::make('groups')
->relationship('groups')
->label('Groups')
->options(Group::all()->pluck('name', 'id'))
->multiple()
->required()
->hidden(fn(Get $get) => $get('type') == UserRoles::CUSTOMER->value),
])->columns(2),
])->columnSpanFull(),
]);

12 replies
FFilament
Created by Lars van Herwijnen on 2/25/2024 in #❓┊help
Is the a way show badges inside a dropdown?
No description
6 replies
FFilament
Created by Lars van Herwijnen on 7/16/2023 in #❓┊help
Dynamically load Form input into schema.
I am trying to dynamically load the schema for a tab. I will explain the behaviour I except: - On the edit/create page for a product I can select a category that that product is in. - A category has characteristics with a type (Number or Text for now maybe more in the future). - After selecting the category the characteristic fields should be displayed to characteristic tabs Does anybody know if something like this is possible? Thanks! Notes; product has a belongsToMany relation with characteristic. The pivot table for product and characteristic has a third column for the value of that combination.
5 replies