Florian Langer
Florian Langer
FFilament
Created by Florian Langer on 9/13/2024 in #❓┊help
Interact with Chart Widget
How can I interact with a chart widget using javascript? So I can call something like chart.resetZoom()?
5 replies
FFilament
Created by Florian Langer on 9/3/2024 in #❓┊help
MorphOne mutateRelationshipDataBeforeCreateUsing does not work properly
For some reason, if I use mutateRelationshipDataBeforeCreateUsing() the related model gets created with the correct values used in the closure, but Filament runs an update query right after the creation, with the original data inputted. I can also confirm this by using mutateRelationshipDataBeforeSaveUsing(), because this runs as well and does not have the mutated data from mutateRelationshipDataBeforeCreateUsing(). I'm confused, why Filament does behave like this. It's a problem, because I cannot set my token without getting SQL exceptions, when Filament tries to update it immediately after creation with the wrong value. Code:
Forms\Components\Section::make()
->relationship('qrToken')
->schema([
Forms\Components\TextInput::make('token'),
])
->mutateRelationshipDataBeforeCreateUsing(function (array $data) {
$data['token'] = QRCodeService::generateQRCodeToken();

return $data;
})
->mutateRelationshipDataBeforeSaveUsing(function (array $data) {
dd($data); // --> Outputs the value inputted by the user NOT the mutated one.
return $data;
}),
Forms\Components\Section::make()
->relationship('qrToken')
->schema([
Forms\Components\TextInput::make('token'),
])
->mutateRelationshipDataBeforeCreateUsing(function (array $data) {
$data['token'] = QRCodeService::generateQRCodeToken();

return $data;
})
->mutateRelationshipDataBeforeSaveUsing(function (array $data) {
dd($data); // --> Outputs the value inputted by the user NOT the mutated one.
return $data;
}),
1 replies
FFilament
Created by Florian Langer on 7/2/2024 in #❓┊help
Checkboxlist: Options can't be checked separately
For some reason, if I check one option all options get checked and vise versa. What am I missing? I'm using it in a custom livewire component:
public ?array $data = [];

public function form(Form $form): Form
{
return $form
->schema([
CheckboxList::make('technologies')
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
]),
])
->statePath('data');
}
public ?array $data = [];

public function form(Form $form): Form
{
return $form
->schema([
CheckboxList::make('technologies')
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
]),
])
->statePath('data');
}
Thank you!
5 replies
FFilament
Created by Florian Langer on 8/18/2023 in #❓┊help
Property [$isCachingForms] not found on component
Inside a widget I get "Property [$isCachingForms] not found on component". https://flareapp.io/share/w5BngJX5 I'm confused, because I can't find this in the documentation.
6 replies
FFilament
Created by Florian Langer on 8/1/2023 in #❓┊help
Customizing the tenant menu
4 replies
FFilament
Created by Florian Langer on 7/21/2023 in #❓┊help
Route [filament.app.auth.logout] not defined.
In my upgraded app I get the following exception after login: Route [filament.app.auth.logout] not defined. I don't really know why this is missing. I never customized the logout.
36 replies
FFilament
Created by Florian Langer on 7/13/2023 in #❓┊help
Insert value from one field to another
Hi, I would like to auto generate the email for my user form from the first and lastname. I tried this, but it didn't work:
CreateAction::make()->form([
Grid::make(2)->schema([
TextInput::make('firstname')
->reactive()
->required(),
TextInput::make('lastname')
->reactive(),
->required(),
]),
TextInput::make('email')
->suffix('@company.com')
->default(fn($get) => $get('firstname') . '.' . $get('lastname'))
->unique()
->required()
]);
CreateAction::make()->form([
Grid::make(2)->schema([
TextInput::make('firstname')
->reactive()
->required(),
TextInput::make('lastname')
->reactive(),
->required(),
]),
TextInput::make('email')
->suffix('@company.com')
->default(fn($get) => $get('firstname') . '.' . $get('lastname'))
->unique()
->required()
]);
How can I make this work? Thank you!
5 replies
FFilament
Created by Florian Langer on 7/12/2023 in #❓┊help
Custom Field with Wizard
Hi, I would like to build a custom field that checks the inserted data from other fields against an API. How can I build this, so the user can't go to the next step until my API returns something positive? Thank you!
13 replies
FFilament
Created by Florian Langer on 7/10/2023 in #❓┊help
Remove container (max-w-7xl) from filament pages
Hi, what's the best way to remove the max-w-7xl container from some of my pages? Is it possible to overwrite these without publishing filament views? Thank you!
3 replies