rinvex / laravel-attributes

⚠️ [ABANDONED] Rinvex Attributable is a robust, intelligent, and integrated Entity-Attribute-Value model (EAV) implementation for Laravel Eloquent, with powerful underlying for managing entity attributes implicitly as relations with ease. It utilizes the power of Laravel Eloquent, with smooth and seamless integration.
MIT License
433 stars 104 forks source link

Can not override tablename of attribute_entity in config #77

Closed appdezign closed 3 years ago

appdezign commented 5 years ago

I'm trying to override the tablenames with the provided config file. This seems to work for all the tables, except for the attribute_entity table.

When I check the AttributeEntity model, the tablename is hardcoded.

protected $table = 'attribute_entity';

In the other models, like Atribute, the tablename is set dynamically in the constructor.

$this->setTable(config('rinvex.attributes.tables.attributes'));

This means that I cannot override the tablename of the attribute_entity table in the config, even though the config does have an entry for this table:

return [
    'tables' => [
        'attributes' => 'attributes',
        'attribute_entity' => 'attribute_entity',
        'attribute_boolean_values' => 'attribute_boolean_values',
        'attribute_datetime_values' => 'attribute_datetime_values',
        'attribute_integer_values' => 'attribute_integer_values',
        'attribute_text_values' => 'attribute_text_values',
        'attribute_varchar_values' => 'attribute_varchar_values',
    ],
];
Omranic commented 3 years ago

Thank you for your patience. This is now fixed in https://github.com/rinvex/laravel-attributes/commit/be1480fa7b251122e2246d99a564da6a6558d056