Is there a way to have user roles and allow eloquent relationships between them?
Most suggestions say that keeping all of your users in one table and model is best. What if you want to have roles where some users of a type belong to other users? Should these be kept in separate tables and models?
A model can relate to itself; just setup a nullable boss_id column (or similar) on your users table then define the relationship pair in the users model
public function boss()
{
return $this->belongsTo(Self::class);
}
public function staff()
{
return $this->hasMany(Self::class, 'boss_id');
}