This is not a default laravel warning, its a server warning stating that the upload is too big and thehrefor can't be uploaded. Either update your server configuration to handle uploads of bigger size or upload your file in chunks depending on what the contents of the file are.
Feb 3, 2024
8
Level 2
PostTooLargeException add warning to response
I handle the PostTooLargeException in handler file in render function like this
if ($e instanceof PostTooLargeException) {
return Json::response(
status: 413,
message: __(key: 'messages.postIsTooLarge', locale: request()->header('Accept-language', 'fa')),
);
}
my project is full in API and I don't have any blade so I always return json when I upload a big file laravel add a warning to my json response like this
<br />
<b>Warning</b>: POST Content-Length of 2959075 bytes exceeds the limit of 1048576 bytes in <b>Unknown</b> on line <b>0</b><br />
{"status":413,"success":false,"message":"The size of data is too large","errors":[],"data":[]}
why and where the laravel add this warning and how can I remove them?
the Json::response() is my custom and a small facade and this warning is not related to the Json facade
Please or to participate in this conversation.