Prefix for table column names #57116
-
I'm currently working on a project where I have to use prefix indicating the table name along with the column name example, I have seen disucssions about prefix for table names but not this, so I would like to know why this pattern is not supported in laravel and if its something we can bring to the framework. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You could override the getAttributeValue function in a base abstract model that extends the Model and do your magic there. Or you could use our decorator lib to undecorate the request and decorate the response if the NOT prefixed columns are needed for outside use only, not for internal use. (it is not clear for us if your db columns have the prefix or not) Basically the decorator allows you to work with mapped columns outside your project and inside you work with the db columns as they are. There was a lib mappable https://github.com/jarektkaczyk/eloquence-mappable |
Beta Was this translation helpful? Give feedback.
-
Why do you want to prefix your columns in your database but not in your codebase? |
Beta Was this translation helpful? Give feedback.
Why do you want to prefix your columns in your database but not in your codebase?