diff --git a/src/Database.php b/src/Database.php index 7c60911..33f251c 100644 --- a/src/Database.php +++ b/src/Database.php @@ -127,3 +127,13 @@ function expectsDatabaseQueryCount(int $excepted, string $connection = null) { return test()->expectsDatabaseQueryCount(...func_get_args()); } + +/** + * Cast a JSON string to a database compatible type. + * + * @return TestCase + */ +function castAsJson(array|object|string $value) +{ + return test()->castAsJson($value); +}