php laravel relation ship in javascript code example
Example: 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();