<commit_before><?php
namespace ANavallaSuiza\Crudoado\Abstractor\Eloquent\Relation;

use ANavallaSuiza\Crudoado\Abstractor\Eloquent\Field;
use App;
use Illuminate\Http\Request;

class Select extends Relation
{
    protected $compatibleEloquentRelations = array(
        'Illuminate\Database\Eloquent\Relations\BelongsTo'
    );

    public function checkEloquentRelationCompatibility()
    {
        if (! in_array(get_class($this->eloquentRelation), $this->compatibleEloquentRelations)) {
            return false;
        }

        return true;
    }

    /**
     * @return array
     */
    public function getEditFields()
    {
        /** @var \ANavallaSuiza\Laravel\Database\Contracts\Dbal\AbstractionLayer $dbal */
        $dbal = $this->modelManager->getAbstractionLayer(get_class($this->eloquentRelation->getRelated()));

        $column = $dbal->getTableColumn($this->eloquentRelation->getOtherKey());

        $repo = $this->modelManager->getRepository(get_class($this->eloquentRelation->getRelated()));

        $select = [];

        $results = $repo->all();

        $options = ['' => ''];

        foreach ($results as $result) {
            $fieldName = $this->config['display'];
            $options[$result->getKey()] = $result->getAttribute($fieldName);
        }

        $config = [
            'name' => $this->eloquentRelation->getForeignKey(),
            'presentation' => $this->presentation,
            'form_type' => 'select',
            'validation' => null,
            'functions' => null
        ];

        $field = $this->fieldFactory
            ->setColumn($column)
            ->setConfig($config)
            ->get();

        $field->setOptions($options);

        $select[] = $field;

        return $select;
    }
<commit_msg>select presentation<commit_after><?php
namespace ANavallaSuiza\Crudoado\Abstractor\Eloquent\Relation;

use ANavallaSuiza\Crudoado\Abstractor\Eloquent\Field;
use App;
use Illuminate\Http\Request;

class Select extends Relation
{
    protected $compatibleEloquentRelations = array(
        'Illuminate\Database\Eloquent\Relations\BelongsTo'
    );

    public function checkEloquentRelationCompatibility()
    {
        if (! in_array(get_class($this->eloquentRelation), $this->compatibleEloquentRelations)) {
            return false;
        }

        return true;
    }

    /**
     * @return array
     */
    public function getEditFields()
    {
        /** @var \ANavallaSuiza\Laravel\Database\Contracts\Dbal\AbstractionLayer $dbal */
        $dbal = $this->modelManager->getAbstractionLayer(get_class($this->eloquentRelation->getRelated()));

        $column = $dbal->getTableColumn($this->eloquentRelation->getOtherKey());

        $repo = $this->modelManager->getRepository(get_class($this->eloquentRelation->getRelated()));

        $select = [];

        $results = $repo->all();

        $options = ['' => ''];

        foreach ($results as $result) {
            $fieldName = $this->config['display'];
            $options[$result->getKey()] = $result->getAttribute($fieldName);
        }

        $config = [
            'name' => $this->eloquentRelation->getForeignKey(),
            'presentation' => $this->getPresentation(),
            'form_type' => 'select',
            'validation' => null,
            'functions' => null
        ];

        $field = $this->fieldFactory
            ->setColumn($column)
            ->setConfig($config)
            ->get();

        $field->setOptions($options);

        $select[] = $field;

        return $select;
    }

{'fraction_non_alphanumeric': 0.14804390655783844, 'fraction_numerical': 0.0, 'mean_word_length': 2.4911591355599216, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 65, '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': '5385308', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1043, 'n_words': 149}