It seems this is due to changes here: https://github.com/laravel/framework/pull/30801
So by that PR description, previously when calling ->toJson() the call would be forwarded to the underlying resource.
So you might expect a different output from 7.x resources when using paginated data. One difference is that paginalition links are under a meta property. Actually this was already done in previous versions when returning the resource as a response instead of calling its ->toJson() method.
You can try doing this:
dd($resource->response()->getData())
This will convert the Resource to a Response object and getData will use json_decode to decode the response's content back.
If you want the payload to be decoded as an associative array use this:
dd($resource->response()->getData(true))
And if you want the raw decoded JSON payload use this instead:
dd($resource->response()->getContent())