\
\
FFilament
Created by \ on 4/14/2024 in #❓┊help
Import Action not working
I've found out where the error originates from and possibly solved it. Inside the CanImportRecords trait, resposible for the actions functionality, I've modified the afterStateUpdated method on the FileUpload component (line 79) to allow the callable function to accept $state variable as an array in addition to TemporaryUploadedFile and null. Dumping the $state variable than reveals this array:1 [▼ // vendor\filament\actions\src\Concerns\CanImportRecords.php:80 "7d0f05fb-1017-4bbd-b017-5036c88bc071" => Livewire\Features\SupportFileUploads\TemporaryUploadedFile {#2265▼ /contents/ } ] The TemporaryUploadedFile object just seems to be encapsulated in the array, so I can just need to retrieve the its value. (starting at line 79)
->afterStateUpdated(function (Forms\Set $set, TemporaryUploadedFile | array | null $state) use ($action) {
if (is_array($state)) {
$state = reset($state);
}

//....
->afterStateUpdated(function (Forms\Set $set, TemporaryUploadedFile | array | null $state) use ($action) {
if (is_array($state)) {
$state = reset($state);
}

//....
I added this condition to the start I'm not sure if other people have problems with this, could do a pull request if so
3 replies
FFilament
Created by \ on 2/23/2024 in #❓┊help
Searching for values in hidden columns
The column in question
TextColumn::make('attendances.employee.name')
->hidden()
->searchable(),
TextColumn::make('attendances.employee.name')
->hidden()
->searchable(),
3 replies