Fonz
Custom column to display a pivot of the current user and tenancy relationship
I am using stancl/tenancy for a plateform with tenancy. Users create an account and ask permission to access a tenant. When they register, I attach the tenant to a user and save some variables to the pivot table. On of those columns is "accepted" with a default value of 0. In filament, the user resource displays all the users that have the relationship of the current tenant. I now would like to display true or false (if they have been accepted or not) in a column based on the value from the pivot.
I would like to do something like this $user->tenants()->where('id', $tenantId)->first(); and display the "accepted" column.
Currently if I do "tenants.id" all the ids of the attached tenants are displayed. "tenants.accepted" returns nothing, probably because there is not with() in the query.
My question is how to I add a custom query to a column?
5 replies
weird month names in date column
Ok found the problem: https://carbon.nesbot.com/contribute/translate/
6 replies
Custom validation rules
I am using this custom rule: https://stackoverflow.com/questions/66280012/laravel-validation-rule-for-either-of-two-fields-required-but-both-should-not-be
9 replies