feat: increase file upload limit to 25MB and disable global post size validation

This commit is contained in:
Yoga Pangestu 2026-05-12 09:40:31 +07:00
parent 1f0db96179
commit a4b285171b
5 changed files with 8 additions and 8 deletions

View File

@ -20,11 +20,10 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Computed;
use Livewire\WithFileUploads;
class SubmitAssignmentPage extends Page implements HasForms
{
use InteractsWithForms, WithFileUploads;
use InteractsWithForms;
protected static string $resource = AssignmentResource::class;

View File

@ -22,11 +22,11 @@ public static function configure(Schema $schema): Schema
->pdfNavPanes(true)
->disk(config('filesystems.default'))
->acceptedFileTypes(['application/pdf', 'application/zip', 'application/x-zip-compressed', 'application/x-zip', 'application/octet-stream', 'multipart/x-zip', '.zip', '.7z'])
->maxSize(1024 * 5)
->maxSize(1024 * 25)
->directory('submissions/'.now()->toDateString())
->required(fn ($get) => ! $get('is_resubmit'))
->hiddenLabel()
->helperText('File PDF atau ZIP dengan ukuran maksimal 5MB.')
->helperText('File PDF atau ZIP dengan ukuran maksimal 25MB.')
->columnSpanFull(),
]);
}

View File

@ -3,6 +3,7 @@
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Middleware\ValidatePostSize;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
@ -11,7 +12,7 @@
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
//
$middleware->remove(ValidatePostSize::class);
})
->withExceptions(function (Exceptions $exceptions): void {
//

View File

@ -130,7 +130,7 @@
'temporary_file_upload' => [
'disk' => env('LIVEWIRE_TEMPORARY_FILE_UPLOAD_DISK'), // Example: 'local', 's3' | Default: 'default'
'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB)
'rules' => ['required', 'file', 'max:25600'], // 25MB
'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...
@ -274,7 +274,7 @@
*/
'payload' => [
'max_size' => 1024 * 1024, // 1MB - maximum request payload size in bytes
'max_size' => 1024 * 1024 * 25, // 25MB - maximum request payload size in bytes
'max_nesting_depth' => 50, // Maximum depth of dot-notation property paths
'max_calls' => 50, // Maximum method calls per request
'max_components' => 20, // Maximum components per batch request

View File

@ -38,7 +38,7 @@
* The maximum file size of an item in bytes.
* Adding a larger file will result in an exception.
*/
'max_file_size' => 1024 * 1024 * 10, // 10MB
'max_file_size' => 1024 * 1024 * 25, // 25MB
/*
* This queue connection will be used to generate derived and responsive images.