💫 The magic of Inertia.js with the simplicity of Blade 💫 - Splade provides a super easy way to build Single Page Applications (SPA) using standard Laravel Blade templates, and sparkle it to make it interactive. All without ever leaving Blade.
Dev environment (OS, Sail/Valet/etc): macOS 14.4.1 (Sonoma), Laravel Valet
Description
When using the Filepond component for uploading multiple files there's an issue when the user removes a file that has already been uploaded. The validation of the subsequent request then fails with the following error:
The attachments.0 field must be a file.
This validation error is raised, although there should no attachment.0 field anymore at all. It seems like deleting a file from the Filepond UI doesn't result in the field being removed from the form payload.
The request validation on the backend looks like this (and works fine when uploading a file and then immediately submitting the form):
<?php
// [...]
use Illuminate\Foundation\Http\FormRequest;
use ProtoneMedia\Splade\FileUploads\HasSpladeFileUploads;
class MessageRequest extends FormRequest implements HasSpladeFileUploads
{
// [...]
public function rules(): array
{
return [
'attachments.*' => ['sometimes', 'file', 'max:102400'],
// [...]
];
}
}
Steps To Reproduce Issue
Create a simple form with the Filepond upload component
Point the form towards a controller that performs a input validation
Description
When using the Filepond component for uploading multiple files there's an issue when the user removes a file that has already been uploaded. The validation of the subsequent request then fails with the following error:
This validation error is raised, although there should no
attachment.0
field anymore at all. It seems like deleting a file from the Filepond UI doesn't result in the field being removed from the form payload.The request validation on the backend looks like this (and works fine when uploading a file and then immediately submitting the form):
Steps To Reproduce Issue