Kyrill71
Kyrill71
FFilament
Created by Kyrill71 on 10/23/2023 in #❓┊help
Hide field based on file upload.
Hello, i'm trying to make an option field hidden based on if a file is uploaded in the fileupload component. but when i tried the code below it gives me this error: 'Cannot use empty array elements in arrays' on the reactive function. Is there another approach I can use to hide the option field based on the file upload, or is there a workaround to resolve this issue?
self::getFileUploadComponent(name:'facturen_array', label: 'invoice')->reactive();
Radio::make('type')
->options([
'kasbetaling' => 'kasbetaling',
'credit factuur' => 'credit factuur',
])->label('papertype')->hidden(fn (Closure $get): bool => !$get('facturen_array'));
self::getFileUploadComponent(name:'facturen_array', label: 'invoice')->reactive();
Radio::make('type')
->options([
'kasbetaling' => 'kasbetaling',
'credit factuur' => 'credit factuur',
])->label('papertype')->hidden(fn (Closure $get): bool => !$get('facturen_array'));
4 replies
FFilament
Created by Kyrill71 on 9/26/2023 in #❓┊help
Can you use IconColumn without database column
Hello, I'm using Breezy and I have a question about displaying the status of two-factor authentication (2FA) for users. In the documentation, I noticed that columns are created using database column names, but I'd like to use the breezy function to determine if a user has enabled 2FA or not, because as far as i noticed there is no database field for that. This is the code i have so far, but did not work:
IconColumn::make('2fa' )->icons(fn (User $user) => $user->hasEnabledTwoFactor() ? ['heroicon-o-lock-closed'] : ['heroicon-o-lock-open']),
IconColumn::make('2fa' )->icons(fn (User $user) => $user->hasEnabledTwoFactor() ? ['heroicon-o-lock-closed'] : ['heroicon-o-lock-open']),
4 replies
FFilament
Created by Kyrill71 on 6/1/2023 in #❓┊help
bulkaction is slow when showing popup
Hello, i have made a update bulk edit, but it is very slow it takes 5-6 seconds after clicking on the edit selected items button, to load the popup with the form. So i tried to test it with the code below, to look if it improves, because i have some logic in the bulkaction. But it still takes 5 seconds. I suspect that the delay is caused by the model itself, as it contains a large number of attributes . For the bulk edit operation, I only require the ID or a subset of the model data, rather than loading all the data. Any suggestions?
BulkAction::make('edit')->label('Geselecteerde bewerken')->icon('heroicon-s-pencil')
->modalSubheading('Test')
->deselectRecordsAfterCompletion() ,
BulkAction::make('edit')->label('Geselecteerde bewerken')->icon('heroicon-s-pencil')
->modalSubheading('Test')
->deselectRecordsAfterCompletion() ,
8 replies