Dumping from inside a JSON endpoint, a queue worker or a middleware corrupts the output you were trying to inspect, so the debugging tool destroys the thing being debugged.
$ php artisan dump-server
Laravel Var Dump Server
listening on tcp://127.0.0.1:9912
# and in the code, unchanged:
dump($order->toArray());
# the dump appears in the terminal, the response stays valid JSON
It is the Symfony component, adopted in 5.7, and it works by sending the dump over a socket when the server is listening and falling back to the normal behaviour when it is not — so leaving a dump() in a branch is exactly as dangerous as it always was. The real value is in queue workers, where the alternative is writing to a log and reading it back. It does not capture dd(), which still dies where it stands.