@json() with a multi-line arrow function whose body is an array literal
confuses Blade's directive parser — it reads the inner '[' as an
unmatched bracket and bails out with "Unclosed '[' on line 744 does
not match ')'". Precompute the array in a plain @php block and hand
the already-evaluated collection to @json() instead.
The bug has been dormant because the compiled view was cached. It
surfaced the moment the view cache got cleared.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>