Laravel keep printing 4 white spaces before the response
<p>when I call to a controller the output that is going out is:  </p>

<blockquote>
<pre><code>    {success:true}
</code></pre>
</blockquote>

<p>instead of:</p>

<blockquote>
<pre><code>{success:true}
</code></pre>
</blockquote>

<p>I have tried to grep and find something like: <code>"   &lt;?php"</code> i got nothing.<br>
I went on each and every class that I added and make sure they are not printing that, and they are not.<br>
Its now 3 hours since I have discover that. I have no hints in the source control/<br>
How can this be debugged?<br>
if not, can I hook laravel till I find the problem and make it disapear via some sort of interception? </p>

<p><strong>UPDATE</strong><br>
I went to the file: public/index.php and put this:</p>

<pre><code>ob_start();
$response = $kernel-&gt;handle(
    $request = Illuminate\Http\Request::capture()
);
$output = ob_get_clean();//$output will have the 4 spaces
</code></pre>

<p>So now the problem is hidden, but still needs to fix it since $output  has the 4 hidden spaces.</p>

<p><strong>Update 2</strong></p>

<p>the entire file</p>

<pre><code>$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app-&gt;make(Illuminate\Contracts\Http\Kernel::class);

ob_start();
$response = $kernel-&gt;handle(
    $request = Illuminate\Http\Request::capture()
);
$output = ob_get_clean();//$output will have the 4 spaces

$response-&gt;send();

$kernel-&gt;terminate($request, $response);
</code></pre>

<p>Thanks</p>