-
Hi @tpetry, I'm trying to use some of the string functions to define virtual columns and, if I try the way I'd expect to use the expressions: $table->string('full_name')
->virtualAs(
(new Concat([
new Coalesce(['first_name', '']),
new Coalesce(['last_name', '']),
]))
); I get an ugly error message:
To fix it, I need to explicitly call getValue, as in: $grammar = DB::connection()->getQueryGrammar();
$table->string('full_name')
->virtualAs(
(new Concat([
new Coalesce(['first_name', '']),
new Coalesce(['last_name', '']),
]))->getValue($grammar)
); Is this an expected behavior? Maybe we could define a helper to use the expressions in this context without having to manually pass them the grammar? |
Beta Was this translation helpful? Give feedback.
Answered by
tpetry
Jun 22, 2023
Replies: 1 comment
-
That is not expected. It is a bug in Laravel. I will work on fix network 😉 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
elcapo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That is not expected. It is a bug in Laravel. I will work on fix network 😉