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

TrentDPT's avatar

Laravel API consumption in Ionic 2

Hi everyone, I've been following along in the Forums TDD course, and have been using Laravel for a bit now, but still a newbie in the world of web design. I also have been playing around with the Ionic 2 framework in order to develop a possible mobile application.

My question is, how do I best create JSON data with an API from laravel, that I can then tap into with Ionic and display it? I might not be describing this correctly, and I feel I understand the concepts overall, but just havent seen the simplest way of doing this or a good step by step tutorial.

Any and all assistance would be fantastic

0 likes
3 replies
ejdelmonico's avatar
Level 53

Well, that depends your your actual requirements but for starters...your stack can be Laravel 5.5, laravel/passport, laravel-fractal and laravel-cors. Those packages will cover everything you need for a basic project. That gives you CORS, access tokens and transformation of json data. You can modify your exception handling for better api responses. Basically, you would end of with various data and error objects for users to consume...like your app. It's not complicated but you will need to be familiar with making an api. If you want really easy, investigate using Strongloop by IBM.

TrentDPT's avatar

Thank you so much for the fast response. Is there anyway i can discuss this further with you to get a better understanding on how to accomplish this?

ejdelmonico's avatar

Sure. You can DM me on twitter. Just click on my profile for the handle.

Please or to participate in this conversation.