Format Pivot fields in Relation Manager
This is the table of my RelationManager.
I have a many-to-many relation with a view properties on my pivot.
I would like to add multiple pivot values together, but can't seem to find a way to do this.
Let's say I have a
User
object with a many-to-many relation with Subscription
.
This many-to-many has a Pivot model called SubscriptionUser
and pivot fields active
and expires_at
:
4 Replies
Anyone? π
Sadly it does not. That works for 1 column, but I want to concat multiple values of the pivot.
Anyone?
You can concatenate the state right?
"${$record->pivot->attr}${$record->pivot->attr2}
Or create Pivot Model and define an attribute in there.
And add ->using(YourPivotModel::class) to your relationship