Depending on a few things, you could return JSON (or whatever you want) depending on if a certain query_string is sent with the URI?
Sep 25, 2014
4
Level 2
Laravel as Web App and API
I have an idea for an web app that I was going to build as both a website / php-web application, and as a native iPhone App. For the Web Application version, I was going to use Laravel.
What Im wondering is, whats the best way to share code between these two as far as endpoints go for the iPhone application? They're both going to need to retrieve the same data at the very least, so it'd be great to have them share that aspect.
In other words, whats the best practice for having a Laravel application serve both the browser-based application, and act as an API for the iPhone app?
Please or to participate in this conversation.