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

Field 'entity_id' doesn't have a default value #57

Closed nguyenvq closed 6 years ago

nguyenvq commented 6 years ago

Hi Pro, I using code below for create new attribute.

app('rinvex.attributes.attribute')->create([
    'slug' => 'size',
    'type' => 'varchar',
    'name' => 'Product Size',
    'entities' => ['App\Models\Company', 'App\Models\Product'],
]);

but system show error:

SQLSTATE[HY000]: General error: 1364 Field 'entity_id' doesn't have a default value (SQL: insert into attribute_entity (entity_type, attribute_id, updated_at, created_at) values

Can help me how to fix it? Thanks

IsraelOrtuno commented 6 years ago

This is a known issue, please use dev-develop branch for now, this is fixed there.

On Wed, 20 Jun 2018 at 20:47, Vo Quoc Nguyen notifications@github.com wrote:

Hi Pro, I using code below for create new attribute. app('rinvex.attributes.attribute')->create([ 'slug' => 'size', 'type' => 'varchar', 'name' => 'Product Size', 'entities' => ['App\Models\Company', 'App\Models\Product'], ]); but system show error:

SQLSTATE[HY000]: General error: 1364 Field 'entity_id' doesn't have a default value (SQL: insert into attribute_entity (entity_type, attribute_id, updated_at, created_at) values

Can help me how to fix it? Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rinvex/attributes/issues/57, or mute the thread https://github.com/notifications/unsubscribe-auth/ABr_yVIVwm9NHgBgv66DpsGP2U_E1yF3ks5t-pikgaJpZM4Uvy1Q .

--

Un saludo Israel Ortuño

Omranic commented 6 years ago

Fixed in the latest tagged release on master, v0.0.6 👍