<commit_before><?php

namespace Parfumix\TableManager\Drivers;

use Parfumix\TableManager\DriverAble;
use Illuminate\Support\Collection;

class Eloquent extends Driver implements DriverAble {

    /**
     * Get source data .
     *
     * @param null $perPage
     * @return array
     */
    public function getData($perPage = null) {
        $source = $this->getSource();

        $paginator = $source->paginate($perPage);
        $rows      = $paginator->getCollection();

        $fields = [];

        $columns = $this->getSource()->getModel()->getFillable();
        if( in_array('skyShow', get_class_methods(get_class($this->getSource()->getModel()))))
            $columns = $this->getSource()->getModel()->skyShow();<commit_msg>sort collection by position if exists.<commit_after><?php

namespace Parfumix\TableManager\Drivers;

use Parfumix\TableManager\DriverAble;
use Illuminate\Support\Collection;

class Eloquent extends Driver implements DriverAble {

    /**
     * Get source data .
     *
     * @param null $perPage
     * @return array
     */
    public function getData($perPage = null) {
        $source = $this->getSource();

        $paginator = $source->paginate($perPage);
        $rows      = $paginator->getCollection()->sortBy('position');

        $fields = [];

        $columns = $this->getSource()->getModel()->getFillable();
        if( in_array('skyShow', get_class_methods(get_class($this->getSource()->getModel()))))
            $columns = $this->getSource()->getModel()->skyShow();
{'fraction_non_alphanumeric': 0.15581854043392504, 'fraction_numerical': 0.0, 'mean_word_length': 3.135869565217391, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3361674', 'n_tokens_mistral': 449, 'n_tokens_neox': 442, 'n_words': 82}