I'll reply to my own question here. I'm not sure why I didn't think of it before, but it seems obvious now that this type of issue can be handled by implementing a "Groups" table in addition to the Roles and Permissions supplied by the Entrust package. For example:
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
use Authenticatable, CanResetPassword, EntrustUserTrait;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'email', 'password'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function groups()
{
return $this->belongsToMany('App\Models\Group', 'group_user', 'user_id', 'group_id');
}
}
class Group extends Model {
protected $table = 'groups';
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function members()
{
return $this->belongsToMany('App\Models\User', 'users_groups', 'group_id', 'user_id');
}
}
This way, users can be assigned Roles via Entrust (Student/Teacher) and simply be assigned to groups that represent their classes. Within the group their Role/Permission set would dictate what they can and cannot do.