Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

according to issue #158 #171

Closed
vahidalvandi opened this issue Jan 26, 2022 · 3 comments
Closed

according to issue #158 #171

vahidalvandi opened this issue Jan 26, 2022 · 3 comments

Comments

@vahidalvandi
Copy link

vahidalvandi commented Jan 26, 2022

hi accroding to #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?

@vahidalvandi vahidalvandi changed the title according to issule #158 according to issue #158 Jan 26, 2022
@Omranic
Copy link
Member

Omranic commented Jan 28, 2022

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 🙂

@Omranic Omranic closed this as completed Jan 28, 2022
@vahidalvandi
Copy link
Author

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

@Omranic
Copy link
Member

Omranic commented Feb 14, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants