I now need to create a Laravel 5 frontend using Blade that will need to call the API to get all its data. I cannot find a video or a guide that explains how to do this. All the guides talk about AngularJS and a RESTful API
Does anyone know a guide or a video that explains how to build a Laravel application that gets its data from an API? I know Guzzle is required, but can't quite get my head around how this works in Laravel using Blade templates etc.
Blade is php and therefore rendered on the server. You will need to include jQuery (or any kind of javascript) to do the ajax requests to your API's. However a front-end framework like AngularJs, ReactJs or Vue.js will make this a lot easier for you.
The most important thing here is that if you have an API it doesn't matter what your view is. Therefor blade is not suited here, because it is php to generate the layout of the page and no API calls and ajax calls.
Also keep in mind that if you want to work with blade (no ajax requests) you can simply return a view in your controller instead of the json
@paulw1107 you seem to have a very particular case for which you probably won't find a video tutorial. My best resource would be here which is very concise. However, you may want to consider @ bobbybouwmann suggestion to use JavaScript to consume that API if that works for you.
Hi @paulw1107 , I am facing the same issue currently. I just don't want to use angular or any frontend framework for now. How did you solve this problem?
For the next time, please create a new thread. This way you will get help faster and it's more searchable for others. These old threads are most of time not relevant anymore since the frontend world is changing so fast!