Why can't Laravel/Eloquent use JOIN for Eager Loading?

前端 未结 3 1258
醉梦人生
醉梦人生 2021-02-05 05:23
belongsTo(\'User\');
    }
}

class User extends Eloquent {

    public fun         


        
3条回答
  •  你的背包
    2021-02-05 05:41

    cats and users likely both have a column named id, leaving your suggested query ambiguous. Laravel's eager loading uses an additional query, but avoids this potential mishap.

提交回复
热议问题