sunel / eav

Entity–attribute–value model (EAV) for Laravel Artisan
https://sunel.github.io/eav/
143 stars 39 forks source link

Custom fields in attribute #48

Closed jonyw4 closed 4 years ago

jonyw4 commented 4 years ago

I need to add more fields for internal use in attribute model. Is this possible? Captura de tela de 2020-03-29 18-19-37

sunel commented 4 years ago

@jonyw4

Right now there is no option to do that.

But you can create local package using path repositories https://getcomposer.org/doc/05-repositories.md#path and include my package as dependency.

Now you can extent https://github.com/sunel/eav/blob/master/src/Attribute.php and do whatever you want.

Additional extent https://github.com/sunel/eav/blob/master/src/Model.php, https://github.com/sunel/eav/blob/master/src/Entity.php, https://github.com/sunel/eav/blob/master/src/AttributeSet.php, https://github.com/sunel/eav/blob/master/src/AttributeGroup.php

to use your version of Attribute model or extend relative class of your package.

And remember to update the model

namespace App;

use Jony\Eav\Model;

class Products extends Model
{
    const ENTITY  = 'product';

    //
}