Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MagicMike's avatar

how to call laravel yelp api to the front-end

Im using this https://github.com/stea4lth/laravel-yelp-api to call yelp api, im just confused on how i would call this to the front end to display it the browser. I was hoping if someone can point me to an example on how I would get the YelpApi.php and call on to the view. Such as do i need Ajax or can blade handle it?

I have a fresh laravel install and I just inserted YelpApi.php and the OAuth.php in the App folder, now I really dont know the steps to go from there to call it into the view

0 likes
1 reply
developernator's avatar
  1. Include the file in the controller using the correct namespace.
  2. Call the Trait.
  3. Do the actions you need to in the appropriate function within the controller.
  4. Send the data back to the view as an object.
  5. Call the data in the view using various methods such a @forloop.
1 like

Please or to participate in this conversation.