© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
wottavm

Issues creating record with multi-file upload

Hello everyone,

I have created a simple resource including the following
FileUpload
FileUpload
.

FileUpload::make('attachments')
    ->directory('transaction_attachments')
    ->multiple()
    ->columnSpanFull(),
FileUpload::make('attachments')
    ->directory('transaction_attachments')
    ->multiple()
    ->columnSpanFull(),


Which uses the
json
json
type in the database.
However, when I want to save the resource, I get an
Array to String conversion
Array to String conversion
error.

I am getting the following data all the way in the Str class.
  6 => array:2 [
    0 => "transaction_attachments/A9w9noTN1feXWe8gWpLOt0qD25fSmv-metad291dGVyX3Zhbl9tYXJydW0ucGRm-.pdf"
    1 => "transaction_attachments/uGq6pUXNVWwQtoTk5UxcnZelzcPJnB-metaTWJvIE1lZGV3ZXJrZXIgSUNUIC0gRU4ucGRm-.pdf"
  ]
  6 => array:2 [
    0 => "transaction_attachments/A9w9noTN1feXWe8gWpLOt0qD25fSmv-metad291dGVyX3Zhbl9tYXJydW0ucGRm-.pdf"
    1 => "transaction_attachments/uGq6pUXNVWwQtoTk5UxcnZelzcPJnB-metaTWJvIE1lZGV3ZXJrZXIgSUNUIC0gRU4ucGRm-.pdf"
  ]


The error is being thrown in:
vendor/filament/filament/src/Resources/Pages/CreateRecord.php:137
vendor/filament/filament/src/Resources/Pages/CreateRecord.php:137


Which is the
handleRecordCreation
handleRecordCreation
method.

And to top off the information regarding the model I have the following setup aside from relations:
    protected $guarded = [];

    protected $cast = [
        'type' => TransactionTypes::class,
        'attachments' => 'array',
    ];

    protected $dates = [
        'paid_at',
    ];
    protected $guarded = [];

    protected $cast = [
        'type' => TransactionTypes::class,
        'attachments' => 'array',
    ];

    protected $dates = [
        'paid_at',
    ];


Has anybody seen this before?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

multi file upload with total size limit
FilamentFFilament / ❓┊help
12mo ago
File upload not getting "stored" with record
FilamentFFilament / ❓┊help
3y ago
Multi tenancy file upload/edit
FilamentFFilament / ❓┊help
11mo ago
Multi record form
FilamentFFilament / ❓┊help
8mo ago