Home  >  Article  >  Backend Development  >  laravel uses orm+query construction to represent concat

laravel uses orm+query construction to represent concat

PHP中文网
PHP中文网Original
2016-08-18 09:15:462228browse


Question:
I hope to use Laravel’s ORM and query construction (without using raw native SQL statements) to use a concat SQL statement like this: select a,b,concat(a,b) from table, but it seems that it is not found. For relevant methods to express such sentences, please ask experts who have experience in this field. It is in the following format:

Table::where(...)->get();

Reply content:

Question:
I hope to use laravel’s ORM and query construction (without raw native SQL statements) to use concat SQL statements like this: select a,b, concat(a,b) from table, but I found that there seems to be no relevant method to express such a statement. I would like to ask someone who has experience in this area for advice. It is in the following format:
Table::where(...)->get();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn