Skip to content

Instantly share code, notes, and snippets.

@piperone
piperone / streamed.php
Created July 23, 2017 16:26 — forked from m4tthumphrey/streamed.php
Laravel response macro for streamed responses with seeking support
<?php
Response::macro('streamed', function($type, $size, $name, $callback) {
$start = 0;
$length = $size;
$status = 200;
$headers = [
'Content-Type' => $type,
'Content-Length' => $size,