I want to upload a file smaller than 8 MB, but when I uploaded a file bigger than 8 MB, it showed this error message.
Warning: POST Content-Length of 15735885 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
I don't want to change any configuration in php.ini. I want to prevent this error message.
I am trying to validate it.
$validator = Validator::make($request->all(), [
'photo' => 'required | mimes:jpeg,jpg,png | max:30000',
]);
if ($validator->fails()) {
dd('Photo is bigger than 3 MB');
}
but it didn't work.