Eloquent’s select() method expects you to give it a list of column names. You are also allowed to alias them, as you discovered in the second (and working) example. But you can’t give it a function. You might want to look at Eloquent’s selectRaw method instead.