Download the PHP package innobraingmbh/onoffice-structure without Composer

On this page you can find all versions of the php package innobraingmbh/onoffice-structure. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package onoffice-structure

onOffice Structure Extractor for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Extract and work with the onOffice enterprise field configuration (Modul- und Feldkonfiguration) in Laravel. The package fetches configurations via innobrain/laravel-onoffice-adapter, transforms them into readonly DTOs, and converts them into various output formats using a strategy pattern.

Features

Installation

You can optionally publish the configuration file:

Usage

Fetching Structure Data

Use the Structure facade or inject Innobrain\Structure\Services\Structure:

Filtering Fields

Fields can have filter configurations that determine their visibility based on other field values. Use the fluent FieldFilterBuilder to narrow down fields:

Writable Fields and Dependent Permitted Values

Hints, dividing lines and compound fields cannot be written to the API. FieldCollection::writable() drops them:

Some permitted values depend on the value of a parent field. In the estate module the objekttyp values depend on objektart. Field::withPermittedValuesFor() narrows a field to the permitted values allowed for a parent value:

Looking Up Fields and Permitted Values

The API accepts field keys in any casing, so field lookups fall back to a case-insensitive match. Module keys are fixed, so module() matches exactly:

Field resolves permitted values by key or label, which is handy for user or AI input:

Sanitizing Input Data

sanitize() removes keys that don't match known fields and values that are not permitted. Items of a multi-select array are removed individually:

violations() reports what sanitize() would drop, as FieldViolation DTOs with a ViolationReason:

Caching

The DTOs serialize cleanly, so a ModulesCollection can be cached as-is. If your cache store restricts unserializable classes, allow the package's classes in config/cache.php:

Converting Data

Module, Field and ModulesCollection implement Convertible and can be transformed using a ConvertStrategy.

Array Conversion

Laravel Validation Rules

Module conversions for Laravel rules and JSON Schema only include writable fields (FieldCollection::writable()). Hints and dividing lines carry no data, and compound fields such as Plz-Ort are set through their individual fields, so they are left out. Converting such a field directly still works.

JSON Schema

Writing a Custom Converter

Implement ConvertStrategy with convertField and convertModule:

Testing Your Application

Structure::fake() (or FieldConfiguration::fake()) replaces the API call with canned modules for the rest of the test. The factories build DTOs without spelling out every constructor argument:

The fake narrows to the requested modules and still throws for unknown module keys. The same modules are returned for every language.

Both factories are Conditionable, so ->when($condition, fn ($field) => $field->default('haus')) works as on query builders.

DTOs

All DTOs are readonly. Field only requires key, label and type; the other properties default to null or an empty collection.

DTO Key Properties
Module key (FieldConfigurationModule), label, fields (FieldCollection)
Field key, label, type (FieldType), length, permittedValues, default, filters, dependencies, compoundFields, fieldMeasureFormat (FieldMeasureFormat)
PermittedValue key, label
FieldDependency permittedValueKey, parentFieldValue (the permitted value is only available when the parent field holds that value, e.g. objekttyp => objektart)
FieldFilter name, config
FieldViolation fieldKey, value, reason (ViolationReason)

Testing

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

Contributing

Contributions are welcome! Please open an issue or pull request. For bug reports, use the Bug Report Template.

Security Vulnerabilities

If you discover a security vulnerability, please send an e-mail to Konstantin Auffinger via the email address in composer.json. All security vulnerabilities will be promptly addressed.

Credits

Built with Spatie's Laravel Package Tools.

License

The MIT License (MIT). Please see composer.json for more information.


All versions of onoffice-structure with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/contracts Version ^12.53|^13.0
innobrain/laravel-onoffice-adapter Version ^1.10|^2.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package innobraingmbh/onoffice-structure contains the following files

Loading the files please wait ...