From 69ebe6d56aa53fc555145ac4717004cd2856a9da Mon Sep 17 00:00:00 2001 From: Aaron Kuzemchak Date: Wed, 5 Sep 2012 16:07:20 -0400 Subject: [PATCH] Allow Input::json() to return array instead of object --- laravel/input.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/laravel/input.php b/laravel/input.php index 2235ad51..b76fc7c6 100644 --- a/laravel/input.php +++ b/laravel/input.php @@ -102,13 +102,14 @@ class Input { /** * Get the JSON payload for the request. * + * @param bool $as_array * @return object */ - public static function json() + public static function json($as_array = false) { if ( ! is_null(static::$json)) return static::$json; - return static::$json = json_decode(Request::foundation()->getContent()); + return static::$json = json_decode(Request::foundation()->getContent(), $as_array); } /**