Level 15
Have a look at Eloquent's Has Many Through relationship.
You can access the typolang's distant users relationships through the Typology model.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys ( my first discussion)
TABLE USERS id, username, typology_id
TABLE TYPOLOGIES id, status(on,off)
TABLE TYPOLOGIES_LANG id, typology_id, name, lang(en,de,fr,it)
MODEL USERS class User extends Authenticatable {
public function typology(){
return $this->belongsTo('App\Typology', 'typology_id');
}
}
MODEL TYPOLOGY
class Typology extends Model {
public function typologylang()
{
return $this->hasMany('App\TypologyLang');
}
}
MODEL TYPOLOGYLANG class TypologyLang extends Model {
}
I would like a list of users with typology with a specific lang ( for example "en").,HOW ? I'm trying but still nothing,thanks
Please or to participate in this conversation.