/** * Generates the role data array using the role model. * * @param Role $role * * @return array */ protected static function getRoleData(Role $role) { $rsa = $role->getRoleServiceAccess(); $roleData = ['name' => $role->name, 'id' => $role->id, 'services' => $rsa]; return $roleData; }