Reputation: 141
this is code from laravel API public/index.php
file.
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
When sending a request it returns without any data and with status code: 200
just from $kernel->handle
.
When I print dd('111');
before
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
it is shown in request's reponse, but when I print after $response = $kernel->handle()
, the request has no response.
Upvotes: 8
Views: 22370
Reputation: 3190
I had exactly the same issue - empty response with 200 http status. Adding breakpoints showed that it couldn't get past the $kernel->handle()
call in the index.php.
Turns out it was caused by whitespace in my .env file
MAIL_FROM_NAME=Test Instance
should have been enclosed in quote marks
MAIL_FROM_NAME="Test Instance"
Upvotes: 9