FilamentF
Filament7mo ago
pjb

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!
Was this page helpful?