У меня есть динамические флажки, и я хотел обновить группу пользователей в Laravel Sentry с помощью метода PUT.
Как-то так же, как и этот неработающий код.
$array_of_group_id = [1,2,3];
$user = Sentry::findUserById(1);
// Find the group using the group id
$updateGroup = Sentry::findGroupById($array_of_group_id);
// Assign the group to the user
if ($user->updateGroup($updateGroup ))
{
// Group assigned successfully
}
else
{
// Group was not assigned
}
Подробнее здесь: https://stackoverflow.com/questions/267 ... vel-sentry