I'm trying to upload a file doing a POST
request to an API
. So when I test it in Tinker it works fine, it takes like 5 seconds to upload the file, but when I test my own endpoint using Postman
I get this error:
"message": "Maximum execution time of 60 seconds exceeded".
Not sure why is it working on Tinker fine but not in the app.
Here's how my request looks like:
$response = Http::attach('file', file_get_contents(asset('storage/' . $attachment->type . '/' . $attachment->name)), $attachment->name)
->post('https://api-example.com/endpoint',
[
'uid' => env('HANDWRYTTEN_UID'),
'type' => 'cover'
]);
return $response->json();
I have cleared the cache and config like this
php artisan cache:clear
and
php artisan config:clear
Any help is very much appreciated! Thank you very much!