diff --git a/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php b/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php index b88f34222872..66867e30ac05 100644 --- a/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php +++ b/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php @@ -75,13 +75,13 @@ public function failureDescription($table): string */ protected function getAdditionalInfo($table) { - $results = $this->database->table($table)->get(); + $results = $this->database->table($table)->limit($this->show)->get(); if ($results->isEmpty()) { return 'The table is empty'; } - $description = 'Found: '.json_encode($results->take($this->show), JSON_PRETTY_PRINT); + $description = 'Found: '.json_encode($results, JSON_PRETTY_PRINT); if ($results->count() > $this->show) { $description .= sprintf(' and %s others', $results->count() - $this->show);