PHP flush() doesn't work with laravel?

laravel, php

Solution

Figured it out, I needed to add ob_flush();

Problem

I'm using Laravel and I need to output data as it happens. When I attempt to load the page outside Laravel, it works just fine. If I use this inside Laravel, it doesn't flush, it waits until the end and prints the results. view.php ``` <?php if (ob_get_level() == 0) ob_start(); for ($i = 0; $i <= 10; $i++){ echo "<br> Line to show. $i"; echo str_pad('',4096)."\n"; ob_flush(); flush(); sleep(1); } ob_end_flush(); ?> ```

Original source