Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Your join method needs one more param ('=' in most cases):

 ->join('role', 'movie_credits.role_id', '=', 'role.role_id')

Oh and by the way select doesn't work on belongsToMany, it will add table.* anyway.

Last updated 2 years ago.
0

Thanks a lot, Jarek! That was the solution!

I actually had to add select('roles.role'); in order for me to be able to use it.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

plokkum plokkum Joined 18 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.