0

I have two similar routes inside both routes/api.php and routes/web.php files:

// routes/api.php
Route::middleware('auth:api')->get('running-server-processes', 'ServerProcessesController@running_list');

// routes/web.php
Route::middleware('auth')->get('running-server-processes', 'ServerProcessesController@running_list');

Also here is the called method:

public function running_list(Request $request){
    dd(request()->wantsJson());
    //=> false
}

The output is always false. I mean in both cases, when I call it by a browser (web) and when I call it through the postman (API). Why? How can I separate them?

Martin AJ
  • 6,261
  • 8
  • 53
  • 111

0 Answers0