Level 1
You need to set the header with Accept: application/json.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am implementing API authentication in Laravel. My routes.php file looks something like :
Route::group([
'middleware' => ['api', 'auth:api'],
], function () {
Route::post('complaint', [
'as' => 'store.customer.complaint',
'uses' => 'Api\Customer\ComplaintController@store',
]);
});
But if I see it through Postman, it shows that it is redirecting me to login page. Is it that Postman's request is not taken as ajax request ?
Please or to participate in this conversation.