PHP-086 / Intermediate
XSS in Blade @json or <script> contexts
Why is this a problem?
When inserting values inside a script block, </script> escapes the block.
How to fix it
blade
<script>const data = @json($user->only('name'), JSON_HEX_TAG | JSON_HEX_APOS);</script>