- 16 Oct, 2012 1 commit
-
-
You can edit the response but you can't overwrite it: ~~~ php <?php // https://gist.github.com/3896743 $response = new stdClass(); echo '1): ' . spl_object_hash($response) . PHP_EOL; // 0000000021e89fcd00000000e93b17ba call_user_func_array(function($response) { $response = new stdClass(); echo '2): ' . spl_object_hash($response) . PHP_EOL; // 0000000021e89fcf00000000e93b17ba }, array($response)); echo '3): ' . spl_object_hash($response) . PHP_EOL; // 0000000021e89fcd00000000e93b17ba call_user_func_array(function($response) { $response = new stdClass(); echo '4): ' . spl_object_hash($response) . PHP_EOL; // 0000000021e89fcf00000000e93b17ba // hash descoped and reused }, array(&$response)); echo '5): ' . spl_object_hash($response) . PHP_EOL; // 0000000021e89fcf00000000e93b17ba ~~~ Otherwise you'd make the new response object and overwrite the values one at a time: ~~~ php <?php // https://gist.github.com/3897032 Route::filter('after', function($response) { $params = \Laravel\Request::$route->parameters; // The 'type' is the last param // example: /product/(:num).(:any) $type = array_pop($params); if($type == 'json') { $res = Response::json($response->content->data); foreach($response as $key => &$value) { $response->$key = $res->$key; } } }); ~~~ Signed-off-by: Blaine Schmeisser <blaine.schmeisser@vitals.com>
Blaine Schmeisser committed
-
- 24 Jun, 2012 1 commit
-
-
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
Jason Lewis committed
-
- 13 Jun, 2012 1 commit
-
-
Signed-off-by: Chris Berthe <chrisberthe@gmail.com>
Chris Berthe committed
-
- 10 May, 2012 1 commit
-
-
Taylor Otwell committed
-
- 03 May, 2012 1 commit
-
-
Andrew Ellis committed
-
- 13 Apr, 2012 1 commit
-
-
Taylor Otwell committed
-
- 21 Mar, 2012 1 commit
-
-
Taylor Otwell committed
-
- 28 Feb, 2012 2 commits
-
-
Taylor Otwell committed
-
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
Taylor Otwell committed
-
- 24 Feb, 2012 1 commit
-
-
Aaron Kuzemchak committed
-
- 14 Feb, 2012 1 commit
-
-
Taylor Otwell committed
-
- 13 Feb, 2012 2 commits
-
-
Taylor Otwell committed
-
Taylor Otwell committed
-
- 12 Feb, 2012 2 commits
-
-
Taylor Otwell committed
-
Taylor Otwell committed
-
- 10 Feb, 2012 2 commits
-
-
Taylor Otwell committed
-
Taylor Otwell committed
-
- 06 Feb, 2012 1 commit
-
-
Taylor Otwell committed
-
- 04 Feb, 2012 1 commit
-
-
Phill Sparks committed
-
- 03 Feb, 2012 2 commits
-
-
Taylor Otwell committed
-
Taylor Otwell committed
-
- 19 Jan, 2012 1 commit
-
-
Eric Barnes committed
-
- 18 Jan, 2012 4 commits
-
-
Taylor Otwell committed
-
Taylor Otwell committed
-
Taylor Otwell committed
-
Taylor Otwell committed
-
- 16 Jan, 2012 1 commit
-
-
Taylor Otwell committed
-
- 23 Nov, 2011 1 commit
-
-
Taylor Otwell committed
-
- 22 Nov, 2011 1 commit
-
-
Taylor Otwell committed
-
- 21 Nov, 2011 3 commits
-
-
Taylor Otwell committed
-
Taylor Otwell committed
-
Taylor Otwell committed
-
- 15 Nov, 2011 2 commits
-
-
Phill Sparks committed
-
Taylor Otwell committed
-
- 09 Nov, 2011 2 commits
-
-
Taylor Otwell committed
-
added section class. refactored session for ioc usage. improved controller. added yielding and sections to blade. general blade improvements.
Taylor Otwell committed
-
- 03 Nov, 2011 1 commit
-
-
Taylor Otwell committed
-
- 27 Oct, 2011 1 commit
-
-
Taylor Otwell committed
-
- 23 Oct, 2011 1 commit
-
-
Taylor Otwell committed
-
- 21 Oct, 2011 1 commit
-
-
Taylor Otwell committed
-