FilamentF
Filament2y ago
riz

Can't use FileUpload with multiple

I have a resource form with FileUpload. FileUpload works fine
with out using the "multiple". But when using multiple

I get this error:

Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) must be of type array, int given,

EMPLOYEE Model
  protected $casts = [
        'attachment_path' => 'array',       
    ];

public function attachment() : HasOne
{
    return $this->hasOne(Attachment::class, 'group_id');
}


Employee Resource

Forms\Components\Section::make()
    ->relationship(
             'attachment',
              condition: fn (?array $state): bool => filled($state['attachment_path']),
             )
    ->schema([
           Forms\Components\FileUpload::make('attachment_path')
             ->multiple()
             ->openable(),
       ])
Was this page helpful?