jeudi 23 avril 2020

Postman getting could get response error while sending response from laravel

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 web.php file:-

Route::match(['get','post'],'/pmjkyppa_home','pmjkyppa\HomeController@get_states');

This is what I am getting in Postman (image attached)



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3byZgeG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire