I\'m doing file uploads via AJAX on Laravel 5. I\'ve got pretty much everything working except one thing.
When I try to upload a file that is too big (Bigger than
My way:
// App\Exceptions\Handler.php
public function render($request, Throwable $e) {
if($request->is('api/*')) {
// Setting Accept header to 'application/json', the parent::render
// automatically transform your request to json format.
$request->headers->set('Accept', 'application/json');
}
return parent::render($request, $e);
}