fix(backup): handle PostTooLargeException gracefully and add client-side file size guard

This commit is contained in:
Ray1111-aa
2026-10-28 11:59:42 +07:00
parent ee83b9d189
commit 03af709a12
3 changed files with 43 additions and 3 deletions
+5 -1
View File
@@ -18,5 +18,9 @@ return Application::configure(basePath: dirname(__DIR__))
]);
})
->withExceptions(function (Exceptions $exceptions): void {
//
$exceptions->render(function (\Illuminate\Http\Exceptions\PostTooLargeException $e, $request) {
$postMax = ini_get('post_max_size') ?: '256M';
$uploadMax = ini_get('upload_max_filesize') ?: '256M';
return back()->with('error', "Ukuran file yang Anda kirim terlalu besar dan melebihi batas konfigurasi server PHP (post_max_size: {$postMax}, upload_max_filesize: {$uploadMax}). Harap naikkan batas konfigurasi php.ini atau gunakan file yang lebih kecil.");
});
})->create();