NilPortugues\Laravel5\JsonApi\Controller\JsonApiTrait::totalAmountResourceCallable PHP Method

totalAmountResourceCallable() protected method

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