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

according to issue #158 #171

Closed vahidalvandi closed 2 years ago

vahidalvandi commented 2 years ago

hi accroding to https://github.com/rinvex/laravel-attributes/issues/158 i add this in register provider

    public function register()
    {

        // Push your entity fully qualified namespace
        app('rinvex.attributes.entities')->push(Company::class);

        Attribute::typeMap([
            'varchar' => \Rinvex\Attributes\Models\Type\Varchar::class,
        ]);

    }

then in Company model i added this code

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Company extends Model
{
    use HasFactory;
    use \Rinvex\Attributes\Traits\Attributable;
}

i want to create a custome value to Company Model . do need to create company table ???? If true then why are we using eav?

Omranic commented 2 years ago

You may need to check the EAV Model first, it's not relevant to everyone, there's specific use cases where you may need it, so if you don't know why you need it, then most probably you don't 🙂

vahidalvandi commented 2 years ago

@Omranic I use this model to build crm but I'm confused how eloquent model works I wish you had an initial demo.

Omranic commented 2 years ago

Hmmm, I'm not sure what exactly not clear, but if you mean Eloquent itself, then your best location to learn about it is the official documentation here https://laravel.com/docs/9.x/eloquent