#Pivot 'as' not working

5 messages · Page 1 of 1 (latest)

steel oxide
#

For some reason Jetstream's membership pivot isn't working. $team->membership always returns null even though the intermediate row is in the database. Any ideas why this is happening?

My ultimate goal is to read auth()->user()->currentTeam->membership->[column_name] for custom data.

crisp yoke
#

What if you load the relationship?

steel oxide
#

The strange thing is that even the pre-built Laravel Jetstream code is not working

#

Just for a sanity check, Jetstream does load 'users'

crisp yoke
#

Your code isn't loading membership on team.