Answer the question
In order to leave comments, you need to log in
How to properly split builder into parts?
seems to be true according to the examples, however, it produces an array with the capabilities of the builder
// так отрабатывает
$queryRes = Customer::query() // DB::table('customers')
->selectRaw('count(*) as subs')
->where('site_id', '=', $site_id)->get();
// а так
$queryRes = Customer::query(); // DB::table('customers')
$queryRes->selectRaw('count(*) as subs')
->where('site_id', '=', $site_id)->get();
// нет (
// причём не важно где разбиваю
{
"connection": {},
"grammar": {},
"processor": {},
"bindings": {
"select": [],
"from": [],
"join": [],
"where": [
"1"
],
"having": [],
"order": [],
"union": []
},
"aggregate": null,
"columns": [
{}
...
Answer the question
In order to leave comments, you need to log in
well, you don’t write down the result anywhere ...
You can make parts of the condition, etc.
But get must be written somewhere.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question