Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

You controller method should be called getAvailableResponders not searchResponders.

And you probably need to return json_encode($results), not echo them.

0

How would the controllermethod be called? Could you make up an example please? I changed to return json_encode, but it doesn't change

0

You specify the method to call in your routes:

Route::post('searchResponders', 'RespondersController@getAvailableResponders');

That getAvailableResponders after @ is the method that will called.

0

The method is specified in my routes file. But I can't directly call that method, as then the app would search for a wrong URL /getAvailableResponders

0

You should use return response(); If you could use route() helper on that ajax url, that would be great.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

sesc360 sesc360 Joined 16 Mar 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.