You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -121,21 +121,28 @@ class PermissionResource extends Resource
|
||||
->schema(function () use ($groupedToggleButton) {
|
||||
$columns = Schema::getColumns('permissions');
|
||||
|
||||
$arcturusPermissions = collect($columns)->filter(function (array $column) {
|
||||
$columnName = $column['name'] ?? null;
|
||||
|
||||
if (! $columnName) {
|
||||
$arcturusPermissions = collect($columns)->filter(function ($value, $key): bool {
|
||||
if (! is_array($value)) {
|
||||
return false;
|
||||
}
|
||||
$columnName = $value['name'] ?? null;
|
||||
if (! is_string($columnName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return str_starts_with($columnName, 'cmd')
|
||||
|| str_starts_with($columnName, 'acc')
|
||||
|| str_ends_with($columnName, 'cmd');
|
||||
})->values();
|
||||
|
||||
return $arcturusPermissions->map(function (array $column) use ($groupedToggleButton) {
|
||||
$columnName = (string) $column['name'];
|
||||
$needsSecondOption = $column['type_name'] == 'enum' && str_ends_with((string) $column['type'], "'2')");
|
||||
return $arcturusPermissions->map(function ($value, $idx) use ($groupedToggleButton) {
|
||||
if (! is_array($value)) {
|
||||
return $groupedToggleButton('', false);
|
||||
}
|
||||
$name = $value['name'] ?? '';
|
||||
$typeName = $value['type_name'] ?? '';
|
||||
$type = $value['type'] ?? '';
|
||||
$columnName = is_string($name) ? $name : '';
|
||||
$needsSecondOption = $typeName === 'enum' && is_string($type) && str_ends_with($type, "'2')");
|
||||
|
||||
return $groupedToggleButton($columnName, $needsSecondOption);
|
||||
})->toArray();
|
||||
|
||||
Reference in New Issue
Block a user