There are a few approaches that can be done to go about this (as I have discovered through other forum posts):
Create a model for each EAV component, e.g. pseudo code:
class Object extends Eloquent{
public function objects(){
return $this->hasMany('Attribute');
}
}
class Attribute extends Eloquent{
public function attributes(){
return $this->hasMany('Value');
}
}
class Value extends Eloquent{
public function values(){
return /* etc. */;
}
}
This will cause a performance hit as there will be 3 queries executed just to retrieve value data.
Use Query Builder
select()->join()->where("attribute", "=", "something")
This will also cause a performance hit.
DB features of Laravel
Basically running the SQL queries directly will probably cause the least amount of overhead, example from Laravel site:
$results = DB::select('select * from users where id = ?', array(1));
Side note:
For this kind of system (where attributes are dynamic and unknown), it would be best to avoid EAV entirely and stick to a No-SQL solution, where working with Laravel would be more intuitive. I have considered this option and will go with this on the long-term.