Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

access laravel eloquent relation in js

Product::where(['product_id'=>$id])->with('category')
->with('user')
->with('productbrand.brand')  // product has onetomany relation 'productbrand'
//with table productbrand and productbrand has onetoone relation 'brand'
//with table brand
->first();
 
PREVIOUS NEXT
Tagged: #access #laravel #eloquent #relation #js
ADD COMMENT
Topic
Name
6+4 =