Pesting form builder with upload file
I am trying to test upload the file in my order. That gives me an error
foreach() argument must be of type array|object, string given.
Here is my code.
7 Replies
I think it should be only
$file
Does it work without the file?No it's not
I'll show you
livewire('order.create')
Shouldn't you pass the livewire component? Like livewire(CreateXX::class)
no it's because I'm using volt
here is error just $file
I'm using Class-based Volt components
there is no app/livewire folder
did you get this working? I think version 3.2.83 breaks single file uploads as it converts them all to an array regardless. My production code works and nothing changed but now the tests fail and its because of https://github.com/filamentphp/filament/commit/888701082d4ccc371d194041bbe53c4f4b9b00f1#diff-eab80cbdc04e95db87de932c13eb10bc20b8734a930ff88999fa3777e784971bR46
GitHub
Merge pull request #12940 from recca0120/fix/test-fake-uploaded-fil...
UploadedFile should be converted to TemporaryUploadedFile
Solution
It's working now. That does not belong with version breaks
Here I wrote a blog about that https://medium.com/@phonelaayy/form-builder-pesting-with-livewire-volt-6eaa6fa94e56