Skip to content

Instantly share code, notes, and snippets.

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