Why don't you use Eloquent ?
In this case you could have something like this
$user = User::with('interests')->find($userId);
foreach($user->interests as $interest) {
dd($interest->field->name, $interest->value->label);
}
To achieve this you should create a model UserInterest (pointing to the user_interests table) and add the field and value relationship like this (the $with attribute will eager load relationship each time you access the model)
Class UserInterest extends Model {
protected $with = ['field', 'value'];
function value() {
return $this->belonsgTo(Value::class);
}
function field() {
return $this->belongsTo(Field::class);
}
}
and then add the interest method to the User model
function interests() {
return $this->hasMany(UserInterest::class);
}
It's hard to do it without coding it but it should be working somehow