I had my ArraySerializer overriden to avoid "[]" values on ->null() to just return null
public function null(): ?array
{
return null;
}
After upgrading from 2.9.1 -> 2.9.4 I get this error
TypeError: Return value of Spatie\Fractalistic\Fractal::jsonSerialize() must be of the type array, null returned in file /var/www/app/vendor/spatie/fractalistic/src/Fractal.php on line 463
I had my ArraySerializer overriden to avoid "[]" values on ->null() to just return null
After upgrading from 2.9.1 -> 2.9.4 I get this error
TypeError: Return value of Spatie\Fractalistic\Fractal::jsonSerialize() must be of the type array, null returned in file /var/www/app/vendor/spatie/fractalistic/src/Fractal.php on line 463
0 [internal function]: Spatie\Fractalistic\Fractal->jsonSerialize()
1 /var/www/app/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php(80): json_encode(Array, 0)
2 /var/www/app/vendor/symfony/http-foundation/JsonResponse.php(54): Illuminate\Http\JsonResponse->setData(Object(Spatie\Fractal\Fractal))
3 /var/www/app/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php(32): Symfony\Component\HttpFoundation\JsonResponse->__construct(Object(Spatie\Fractal\Fractal), 200, Array, false)
4 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(818): Illuminate\Http\JsonResponse->__construct(Object(Spatie\Fractal\Fractal))
5 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(789): Illuminate\Routing\Router::toResponse(Object(Illuminate\Http\Request), Object(Spatie\Fractal\Fractal))
6 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), Object(Spatie\Fractal\Fractal))
7 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
8 /var/www/app/app/Core/Http/Middleware/Country.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))