I\'m trying to output a dynamic javascript file for inclusion from external websites with the [script src=\"\"] tag. As the view is using the Blade engine, it\'
Laravel lets you modify header information via the Response class, so you have to make use of it. Remove the header line from your view and try it like this in your controller:
$contents = View::make('embedded')->with('foo', $foo);
$response = Response::make($contents, $statusCode);
$response->header('Content-Type', 'application/javascript');
return $response;