You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering a problem with customizing column labels for relationship fields in a Filament resource. Specifically, I'm using the getColumnsOverwrite method to modify the columns displayed in tables, forms, and infolists. However, when attempting to modify the labels for relationship fields such as users.name and category.name, the changes don't seem to take effect as expected.
Sure, here's a description of your issue that you can use to ask the community:
Expected Behavior:
I expect that by specifying custom labels using the label method for relationship fields in the getColumnsOverwrite method, the column labels in the generated views (tables, forms, etc.) should be updated accordingly.
Actual Behavior:
Despite specifying custom labels for relationship fields, such as users.name and category.name, using the label method in the getColumnsOverwrite method, the column labels remain unchanged in the generated views. The labels continue to display the default relationship field names (users.name and category.name) instead of the specified custom labels.
The text was updated successfully, but these errors were encountered:
@SouhailBouaouiss, I could not understand what you are trying to do. I think it's not possible to set custom labels with filament auto panel without some kind of trick.
Can you share a code example of what you are trying to do?
@miguilimzero In my database schema, I have a column named category_id, which serves as a foreign key referencing the id column in the categories table. To display the corresponding category name instead of the category ID in my application, I have established a relationship between the category_id column and the categories table But I can not get the category name instead of the category id in the table.
I think you cannot do that. You are trying to overwrite the column category.id with category.name, and this does not work. You can only overwrite columns with the same name. Or you can add new columns with the trick described at #1.
I'm encountering a problem with customizing column labels for relationship fields in a Filament resource. Specifically, I'm using the getColumnsOverwrite method to modify the columns displayed in tables, forms, and infolists. However, when attempting to modify the labels for relationship fields such as users.name and category.name, the changes don't seem to take effect as expected.
Sure, here's a description of your issue that you can use to ask the community:
Expected Behavior:
I expect that by specifying custom labels using the label method for relationship fields in the getColumnsOverwrite method, the column labels in the generated views (tables, forms, etc.) should be updated accordingly.
Actual Behavior:
Despite specifying custom labels for relationship fields, such as users.name and category.name, using the label method in the getColumnsOverwrite method, the column labels remain unchanged in the generated views. The labels continue to display the default relationship field names (users.name and category.name) instead of the specified custom labels.
The text was updated successfully, but these errors were encountered: