Anyway of displaying a deleted relation name in the table builder?
I've tried disabling the global scope, modifying the table query to pull the relation with trashed.
The relation is a belongs to many (if that changes anything)
TextColumn::make('teams.nome')
->placeholder('N.D.')
->label('Instituição')
6 Replies
not sure but I think you may edit the relation in the Models/Team itself to includeTrashed maybe
i tried, didnt work :/
i was thinking about making included when getting the user
You might then override the global query builder of your resource to add a
->with(['teams'=> ...])
the query here will include the witTrashed maybetried that one too, but i may be wrong be cause i did
$query->teams()->withTrashed()
maybe i should have done with
->with(['teams' => trashed()])
like you said
I think it will be something like:
this is an override of the resource getEloquentQuery method
edit this
->with(['teams' => trashed()])
to ->with(['teams' => fn($query)=> $query->withTrashed()])
and trywell, thanks to you i founded a "bug" in my code
quite funny that is happening a ->after()
that i deleted a long time ago that detached all the users from the team
but it only happens in the one in the table not the one in the editpage
but, this didnt work