protected function deleteManyJointPermissionsForEntities($entities)
{
$query = $this->jointPermission->newQuery();
foreach ($entities as $entity) {
$query->orWhere(function ($query) use($entity) {
$query->where('entity_id', '=', $entity->id)->where('entity_type', '=', $entity->getMorphClass());
});
}
$query->delete();
}