79268911

Date: 2024-12-10 16:07:31
Score: 4.5
Natty: 4
Report link

I upgraded my laravel 8 backend for SPA (vue.js, sanctum) to laravel 11, and post request /broadcasting/auth returns HTML response instead of json like { auth: "..." }

In previous version Broadcast::routes has been called from BroadcastServiceProvider, but not is it under the hood of laravel framework in ApplicationBuilder.php, and previously I've added sanctum middleware like this Broadcast::routes(['middleware' => ['auth:sanctum']]);

How should I do it in laravel 11?

Reasons:
  • Blacklisted phrase (1): How should I
  • No code block (0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Eugene B.