Select custom columns from Laravel belongsToMany relation

后端 未结 3 1762
悲哀的现实
悲哀的现实 2021-01-13 05:06

Im trying to select only specific attributes on the many-to-many relation users, just like in one-to-one. But using select() on belongsToMany

3条回答
  •  情深已故
    2021-01-13 05:47

    According to Taylor Otwell it is not currently possible: https://github.com/laravel/laravel/issues/2679

    I have tried to use a lists('user.email') at the end of the query but I can't make it work.

提交回复
热议问题