withoutGlobalScope() with Column Relationships
Let's a say I have a table column that uses a relationship, like this example from the docs:
https://filamentphp.com/docs/3.x/tables/columns/relationships#displaying-data-from-relationships
TextColumn::make('author.name')
Now let's assume that the model from the author
relationship has a global scope on it. That global scope is going to ultimately prevent values from showing in the relationship column for the relevant non-scoped records.
How do I apply withoutGlobalScope()
or withoutGlobalScopes()
to the relationship column's query?
Thanks!2 Replies
You wouldn't apply it to the column, you would apply it to the resource or table query itself.
So (depending on what you want) either do
Something like that.
Or you could remove the scope from the relationship itself. Anyway, depends on what you want to do
eg
Thanks @ChesterS ! Looks like that second method is going to work for my use-case since I'll need this across multiple resources.