Solution provided above worked for me, as I am also using Laravel 11.x.
@zeeshan When Making an API request, also include accept: application/json in the header, and it will work fine.