I'm currently building a web app using Laravel 5.1 and would like to start creating a native application so that my users can use their phones. I have decided that using the Ionic Framework is likely the best approach for the app and just have a few questions on marrying the two together.
I've got routes in Laravel that looks like this example:
app.dev/geckos
- This is a GET
request.
Which takes the currently authenticated user, uses their ID and fetches all geckos that match their user ID. It does return a blade view however.
I assume that when working with something like Ionic, the GET
request would need to return JSON
instead on order to loop through properly?
Is there a way that I can alter my controller to serve JSON
based on if the route was something like this instead:
http://ift.tt/1SRqoIH
Both routes would use the GeckoController@index
method, ideally I just don't want to repeat the code.
I'm fairly new to Laravel and very new to Ionic. So if I'm over complicating this theory please let me know.
Any information is appreciated on this,
Andy
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire