jeudi 20 août 2015

Getting a result from it's hasMany relationship in AngularJS and Laravel?

In Laravel, I have the API set up so /products shows all products in a JSON format, and that works great. Each product has, and can have many stocks. A stock is say the amount of the product we have, and the size of the product. So each product can have multiple stocks, such as they could have 4 of one size, 5 of another.

I've just hit a brick wall in my AngularJS where I'm trying to get all products where the product contains a stock (which is set up as a relationship in Laravel, hasMany, and the stocks table has a product_id column). I really cannot figure out how to do this in Angular. Any help towards the right direction would be great!

laravel php laravel 5 laravel 4 laravel with laravel tutorial

Aucun commentaire:

Enregistrer un commentaire