src/Commands/DefaultCommand/IndexCommand.php
public function handle()
    {
        $class = $this->modelClass;
        $perPage = $this->getPerPageFromModelClass($class);
        $fields = $this->getFieldsFromRequest();

        $query = $class::withRequestSort()->withRequestEmbed();
        $query = $this->addWhereStatements($query, $class);

        // If `count` param is present, return early since we don't want to paginate
        if (Request::get('count')) {
            return [ 'count' => $query->count() ];
        }

        return $query->paginate($perPage, $fields);
    }
public function handle()
    {
        $class = $this->modelClass;
        $perPage = $this->getPerPageFromModelClass($class);
        $fields = $this->getFieldsFromRequest();

        $query = $class::withRequestSort()->withRequestEmbed();
        $query = $this->addWhereStatements($query, $class);

        // If `count` param is present, return early since we don't want to paginate
        if (Request::get('count')) {
            return [ 'count' => $query->count() ];
        }

        return $query->paginate($perPage, $fields);
    }
Execute the command.

@return \Illuminate\Database\Eloquent\Model