lupoz
lupoz
FFilament
Created by lupoz on 10/24/2024 in #❓┊help
Count chars field not working
I want to create a column that shows the length of the field title:
TextColumn::make('Title')
->formatStateUsing(function ($record) {
$length = strlen($record->title);
return "<b>{$length}</b> /" . LENGTH_TITLE;
})
->html(),
TextColumn::make('Title')
->formatStateUsing(function ($record) {
$length = strlen($record->title);
return "<b>{$length}</b> /" . LENGTH_TITLE;
})
->html(),
4 replies
FFilament
Created by lupoz on 12/8/2023 in #❓┊help
How can I call a API route in a form?
I need to compile a text area with some data via Ajax. I cheated a controller that collect the data and a route for call the controller. How can implement that in a FIlament form?
3 replies
FFilament
Created by lupoz on 12/7/2023 in #❓┊help
live method trim himself
When I compile name field, slug and title are update, but the last two chars of name are trimmed:
TextInput::make('name')
->columnSpan(10)
->required()
->placeholder('Love')
->live()
->afterStateUpdated(fn ($state, callable $set) => [
$set('title', 'Books about ' . $state),
$set('slug', Str::slug('Books about ' . $state))
]),
TextInput::make('name')
->columnSpan(10)
->required()
->placeholder('Love')
->live()
->afterStateUpdated(fn ($state, callable $set) => [
$set('title', 'Books about ' . $state),
$set('slug', Str::slug('Books about ' . $state))
]),
8 replies
FFilament
Created by lupoz on 12/2/2023 in #❓┊help
Can I set default value of toggle?
I want to make active by default so must be 1 or true... Toggle::make('active') ->onColor('success') ->offColor('danger'),
3 replies