diff --git a/app/Http/Controllers/Admin/Authority/RoleTranslationsController.php b/app/Http/Controllers/Admin/Authority/RoleTranslationsController.php index e42a9c327..aa0f66e89 100644 --- a/app/Http/Controllers/Admin/Authority/RoleTranslationsController.php +++ b/app/Http/Controllers/Admin/Authority/RoleTranslationsController.php @@ -53,20 +53,20 @@ private function getTranslations() ->whereNotNull('roles') ->distinct() ->pluck('roles') - ->reduce(fn(Collection $carry, array $row) => $carry->concat($row), collect()) + ->flatten() ->unique() ->sort() ->map(function (string $id) { return (object) [ 'id' => $id, 'sk' => Lang::hasForLocale("authority.roles.{$id}", 'sk') - ? Lang::get("authority.roles.{$id}", [], 'sk') + ? Lang::get("authority.roles.{$id}", locale: 'sk') : null, 'cs' => Lang::hasForLocale("authority.roles.{$id}", 'cs') - ? Lang::get("authority.roles.{$id}", [], 'cs') + ? Lang::get("authority.roles.{$id}", locale: 'cs') : null, 'en' => Lang::hasForLocale("authority.roles.{$id}", 'en') - ? Lang::get("authority.roles.{$id}", [], 'en') + ? Lang::get("authority.roles.{$id}", locale: 'en') : null, ]; });