->visible(function (array $arguments, Repeater $component): bool {
$items = $component->getState();
$activeItem = $items[$arguments['item'] ?? null] ?? null;
dump($activeItem);
if (!$activeItem || !$activeItem['role_id']) return true;
return !self::$ownerRoles->find($activeItem['role_id']);
})->color(function (array $arguments, Repeater $component): string {
$items = $component->getState();
$activeItem = $items[$arguments['item'] ?? null] ?? null;
//dump($activeItem);
if (!$activeItem || !$activeItem['role_id']) return 'danger';
return !self::$ownerRoles->find($activeItem['role_id']) ? 'danger' : 'gray';
})
->visible(function (array $arguments, Repeater $component): bool {
$items = $component->getState();
$activeItem = $items[$arguments['item'] ?? null] ?? null;
dump($activeItem);
if (!$activeItem || !$activeItem['role_id']) return true;
return !self::$ownerRoles->find($activeItem['role_id']);
})->color(function (array $arguments, Repeater $component): string {
$items = $component->getState();
$activeItem = $items[$arguments['item'] ?? null] ?? null;
//dump($activeItem);
if (!$activeItem || !$activeItem['role_id']) return 'danger';
return !self::$ownerRoles->find($activeItem['role_id']) ? 'danger' : 'gray';
})