I am creating API in Laravel and I am trying to get response in postman
, but I am not getting response instead I am receiving "could not get any response" in postman
.
Below is the code I am using controller:-
public function get_states(Request $request){
$get_states = DB::table('states')->get();
return response()->json($get_states);
return view('frontend.pmjkyppa.pmjkyppa_getstates',compact('get_states'));
}
And below is the code I am using in routes file:-
Route::match(['get','post'],'/pmjkyppa_home','pmjkyppa\HomeController@get_states');
This is what I am getting in Postman (image attached)
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire