📜  在 js 中访问 laravel eloquent 关系 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:45.393000             🧑  作者: Mango

代码示例1
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();