Spatie Permission Exceptions PermissionDoesNotExist There is no permission named `1` for guard `web`.
convert the id field for integer before calling the syncPermissions method
$data = array(); foreach ($permissions as $key => $item){$data[$key] = (int)$item;}
if (!empty($data)){$role->syncPermissions($data);}