<commit_before><?php

namespace Yajra\DataTables;

use Illuminate\Support\Collection;

class Factory
{
    /**
     * Datatables request object.
     *
     * @var \Yajra\DataTables\Request
     */
    protected $request;

    /**
     * HTML builder instance.
     *
     * @var \Yajra\DataTables\Html\Builder
     */
    protected $html;

    /**
     * Gets query and returns instance of class.
     *
     * @param  mixed $source
     * @return mixed
     * @throws \Exception
     */
    public static function of($source)
    {
        $engines  = config('datatables.engines');
        $builders = config('datatables.builders');

        if (is_array($source)) {
            $source = new Collection($source);
        }

        foreach ($builders as $class => $engine) {
            if ($source instanceof $class) {
                $class = $engines[$engine];

                return new $class($source);
            }
        }

        throw new \Exception('No available engine for ' . get_class($source));
    }

    /**
     * Get request object.
     *
     * @return \Yajra\DataTables\Request
     */
    public function getRequest()
    {
        return resolve('datatables.request');
    }

    /**
     * Datatables using Query Builder.
     *
     * @param \Illuminate\Database\Query\Builder|mixed $builder
     * @return \Yajra\DataTables\QueryDataTable
     */
    public function queryBuilder($builder)
    {
        return new \Yajra\DataTables\QueryDataTable($builder);
    }<commit_msg>Add method to get config instance from factory.<commit_after><?php

namespace Yajra\DataTables;

use Illuminate\Support\Collection;

class Factory
{
    /**
     * Datatables request object.
     *
     * @var \Yajra\DataTables\Request
     */
    protected $request;

    /**
     * HTML builder instance.
     *
     * @var \Yajra\DataTables\Html\Builder
     */
    protected $html;

    /**
     * Gets query and returns instance of class.
     *
     * @param  mixed $source
     * @return mixed
     * @throws \Exception
     */
    public static function of($source)
    {
        $engines  = config('datatables.engines');
        $builders = config('datatables.builders');

        if (is_array($source)) {
            $source = new Collection($source);
        }

        foreach ($builders as $class => $engine) {
            if ($source instanceof $class) {
                $class = $engines[$engine];

                return new $class($source);
            }
        }

        throw new \Exception('No available engine for ' . get_class($source));
    }

    /**
     * Get request object.
     *
     * @return \Yajra\DataTables\Request
     */
    public function getRequest()
    {
        return resolve('datatables.request');
    }

    /**
     * Get config instance.
     *
     * @return \Yajra\DataTables\Config
     */
    public function getConfig()
    {
        return resolve('datatables.config');
    }

    /**
     * Datatables using Query Builder.
     *
     * @param \Illuminate\Database\Query\Builder|mixed $builder
     * @return \Yajra\DataTables\QueryDataTable
     */
    public function queryBuilder($builder)
    {
        return new \Yajra\DataTables\QueryDataTable($builder);
    }
{'fraction_non_alphanumeric': 0.12186823383854005, 'fraction_numerical': 0.0, 'mean_word_length': 1.908273381294964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6462124', 'n_tokens_mistral': 945, 'n_tokens_neox': 930, 'n_words': 205}