我正在尝试在集合上使用findmany(),并以此检查它是否为集合:
if ($join instanceof Collection) {
log::info("deemed collection");
}else{
log::info("not deemed collection");
}
虽然它似乎是一个集合,但仍然出现错误:
BadMethodCallException
Method Illuminate\Database\Eloquent\Collection::findmany does not exist.
[当我尝试在其上使用findmany()时,]:
$join = $join->findmany(1);
$ join是这样创建的:
$join = coretable::with($permittedTables)->get();
$permittedTables
是表名的数组,因此集合可以由任意数量的表和表的组合组成。
为什么不能使用此集合中的findmany()方法?应该可以从集合中访问它,不是吗?
$ join = $ join-> findMany([1,2,3]);
findMany使用ID数组。
并且findMany应该是驼色的。