Hi Guys,
For uploading files I’ve added a rule ro the php config/livewire.php
file like so php 'file|mimes:png,jpg,jpeg,zip|max:100000'
This is fine, it works as expected.
The problem is, I have multiple file inputs on a form, some I want to accept images and another one I only want to accept zip files.
How can I add multiple rules within the config file to validate multiple inputs ?
Here’s my current temporary_file_upload config
'temporary_file_upload' => [
'disk' => null, // Example: 'local', 's3' Default: 'default'
'rules' => 'file|mimes:png,jpg,jpeg,zip|max:100000', // Example: ['file', 'mimes:png,jpg'] Default: ['required', 'file', 'max:12288'] (12MB)
'directory' => null, // Example: 'tmp' Default 'livewire-tmp'
'middleware' => null, // Example: 'throttle:5,1' Default: 'throttle:60,1'
'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs.
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpeg', 'mpga', 'webp', 'wma'
],
],