whereNotIn and when param class type is not same #35810
-
User::whereNotIn("id", function ($builder1) {
})->when(1, function (QueryBuilder $builder2) {
})) the class type of variable the class type of variable Why can't variables |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
because all query builder that operate on the database, i.e : now all "helpers" method such as note: since eloquent builder is also instance of basic query builder, all basic query method also implemented. |
Beta Was this translation helpful? Give feedback.
because all query builder that operate on the database, i.e :
where
,select
, etc, is directly operate on the PDO, if you ever use basic query builder usingDB
facade, that's why the signature is basic query builder.now all "helpers" method such as
when
,scope
is directly connected with eloquent, thus. eloquent builder is used.note: since eloquent builder is also instance of basic query builder, all basic query method also implemented.