diff --git a/src/PermissionBooleanGroup.php b/src/PermissionBooleanGroup.php index 01ad378..60932e5 100644 --- a/src/PermissionBooleanGroup.php +++ b/src/PermissionBooleanGroup.php @@ -26,7 +26,13 @@ public function __construct($name, $attribute = null, callable $resolveCallback $this->options(static function () { $permissionClass = app(PermissionRegistrar::class)->getPermissionClass(); - return $permissionClass::get()->pluck('name', 'name')->toArray(); + return $permissionClass::get()->flatMap(function($permission) { + $display_name = is_array(__('nova-permission-tool::permissions.display_names')) + ? __('nova-permission-tool::permissions.display_names.'.$permission->name) + : $permission->name; + + return [$permission->name => $display_name]; + })->toArray(); }); }