NilPortugues\Laravel5\JsonApi\Controller\JsonApiTrait::totalAmountResourceCallable PHP Méthode

totalAmountResourceCallable() protected méthode

Returns the total number of results available for the current resource.
protected totalAmountResourceCallable ( ) : callable
Résultat callable
    protected function totalAmountResourceCallable()
    {
        return function () {
            $idKey = $this->getDataModel()->getKeyName();
            return $this->getDataModel()->query()->count([$idKey]);
        };
    }