Nov 6, 2022
0
Level 8
Dynamically translating table column names based on DB - how to save it case of a change?
I currently display different tables dynamically using Schema::getColumnListing($table_name);
And using Localization to translate from the column names to the actual name I want to display in the header.
But now that I think about it - it might not be the best idea because if a column changes on the DB, the translation won't work and will appear as some random string from the localization file.
Is there a way to improve that?
I recently changed a few tables in which the column names were hardcoded in the <th> so there was no issue.
Should I abandon the idea of dynamically creating the table?
Please or to participate in this conversation.