IsraelOrtuno / Eavquent

EAV modeling package for Laravel and Eloquent – This package is abandoned, please use this fork https://github.com/rinvex/attributes
63 stars 13 forks source link

Get attributes id with entity attributes #39

Closed pinguinjkeke closed 8 years ago

pinguinjkeke commented 8 years ago

How to get attribute id with entity attributes?

IsraelOrtuno commented 8 years ago

I guess you want to get an entity with attributes right?

$company = Company::with('eav')->get();
pinguinjkeke commented 8 years ago

No. I'm developing administrative part of application and I need to access value id for collection attributes. There are id, content, attribute_id and entity_id in value table. I need that id

IsraelOrtuno commented 8 years ago

Can you please explain it more widely? I am sorry but I do not understand.

rockymontana commented 8 years ago

You dont really need that because the attributes functions as properties in the model. So you save them by their property names (that is: the model property name === Attribute::whereName($name)).