diff --git a/src/Illuminate/Testing/TestResponse.php b/src/Illuminate/Testing/TestResponse.php index 90930a1d7464..3e46e7a17161 100644 --- a/src/Illuminate/Testing/TestResponse.php +++ b/src/Illuminate/Testing/TestResponse.php @@ -1349,9 +1349,10 @@ protected function session() /** * Dump the content from the response. * + * @param string|null $key * @return $this */ - public function dump() + public function dump($key = null) { $content = $this->getContent(); @@ -1361,7 +1362,11 @@ public function dump() $content = $json; } - dump($content); + if (! is_null($key)) { + dump(data_get($content, $key)); + } else { + dump($content); + } return $this; }