F
Filament3w ago
xxx

Need help on TextColumn

return $table
->query(
$currentTeam->users()->withPivot('role')
->get()
->toQuery()
)
->columns([
TextColumn::make('name')
->label(__('Name'))
->searchable()
->sortable(),

TextColumn::make('email')
->label(__('Email'))
->searchable()
->sortable(),
TextColumn::make('role')
->label(__('Role')),
])
return $table
->query(
$currentTeam->users()->withPivot('role')
->get()
->toQuery()
)
->columns([
TextColumn::make('name')
->label(__('Name'))
->searchable()
->sortable(),

TextColumn::make('email')
->label(__('Email'))
->searchable()
->sortable(),
TextColumn::make('role')
->label(__('Role')),
])
How to show up role, i use jetstream roles. (membership.role) and (pivot_role) not working also (pivot.role)
2 Replies
Mohamed Ayaou
Mohamed Ayaou3w ago
Check your model relations, it should have e.g membership() relation first, and try too to modify the query to load the relations using the ->with('membership') method in general it is just a relation issue, be sure about the names used in your model relation the ->with() part is only for eager loading
xxx
xxxOP3w ago
The role is under relations -> membership -> role. idk how to get it

Did you find this page helpful?