简体   繁体   中英

Laravel getCountForPagination() returning Object instead of int

I am trying to get the number of results with

$total = $this->query->getCountForPagination();

And instead of receiving an (int) like I see on the documentation, a object(Illuminate\\Database\\Eloquent\\Builder) is returned

The function is called from Query/Builder.php class which returns an int .. but I think it gets converted somehow along the way.

Any reason for that ?

使用: $total = $this->query->getQuery()->getCountForPagination();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM