Skip to content

Should accessor methods be available through Column::make? #1103

Closed Answered by lrljoe
Edim7 asked this question in Q&A
Discussion options

You must be logged in to vote

So! The accessor methods won't work as those all feed into the Builder query, and so they need to be actual database fields.

A few different options here.

I've got a PR open #1082 - which will allow you to add some selectRaw columns in there, so you'll be able to do a concat easily enough and return it as a field for use. Not sure if/when that'll make it into core though!

Another alternative of course depending on your database software is to define the attribute in there

Or you can of course as you said create a Label column.

Replies: 3 comments 2 replies

Comment options

lrljoe
Mar 17, 2023
Collaborator Sponsor

You must be logged in to vote
0 replies
Answer selected by Edim7
Comment options

You must be logged in to vote
1 reply
@lrljoe
Comment options

lrljoe Mar 18, 2023
Collaborator Sponsor

Comment options

lrljoe
Mar 18, 2023
Collaborator Sponsor

You must be logged in to vote
1 reply
@Edim7
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants