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

paulw1107's avatar

Laravel 5 frontend for use with a RESTful API

I have a RESTful API that returns JSON.

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.

0 likes
5 replies
bobbybouwmann's avatar

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

1 like
mehany's avatar

@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.

vijayrana's avatar

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?

bobbybouwmann's avatar

@vijayrana Not sure if this thread is still useful, because 2 years ago we didn't have Laravel Mix etc.

This tutorial might help: https://sebastiandedeyne.com/typescript-with-laravel-mix

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!

Please or to participate in this conversation.