---
title: "Config – API-Referenz · Quittio"
description: "Configuration of the core without Laravel. The Laravel package translates config/quittio.php into it (Quittio\\Laravel\\Support\\ConfigMapper), whose layout differs from the keys of fromArray()."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Config"
locale: de
meta:
  "og:description": "Configuration of the core without Laravel. The Laravel package translates config/quittio.php into it (Quittio\\Laravel\\Support\\ConfigMapper), whose layout differs from the keys of fromArray()."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "Config – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core)

# Config

final readonly class in quittio/core

`Quittio\Core\Config` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/core/src/Config.php#L22)

Configuration of the core without Laravel. The Laravel package translates config/quittio.php into it (Quittio\\Laravel\\Support\\ConfigMapper), whose layout differs from the keys of fromArray().

## Constants \#

| Constant | Value | Description |
| --- | --- | --- |
| `VALIDATION_ERROR` | `'error'` | |
| `VALIDATION_OFF` | `'off'` | |
| `VALIDATION_WARN` | `'warn'` | |

## Properties \#

| Property | Type | Description |
| --- | --- | --- |
| `$autoUpgradeProfile` readonly | `bool` | |
| `$b2cEmbedXml` readonly | `bool` | |
| `$blockOnWarnings` readonly | `bool` | |
| `$calculation` readonly | `[CalculationPolicy](https://quittio.dev/docs/api/Quittio/Core/Calculation/CalculationPolicy)` | what the calculator does with declared amounts |
| `$cancellationStrategy` readonly | `string\|null` | credit\_note or negative\_invoice; null = default of the country pack |
| `$country` readonly | `?string` | |
| `$countrySettings` readonly | `array<string, array<string, mixed>>` | settings of the country packs by lower-case code, e.g. \['de' => \['consumer\_default\_notice' => false]] (Laravel: quittio.countries.de) |
| `$dueDays` readonly | `int\|null` | due date (BT-9) = issue date + days for invoices without due date and payment terms |
| `$filename` readonly | `string` | |
| `$format` readonly | `string\|null` | default output format, null = automatic choice |
| `$girocodeAmount` readonly | `string` | |
| `$kosit` readonly | `array{Quittio\Core\mode?: string, Quittio\Core\url?: string, Quittio\Core\jar?: string\|null, Quittio\Core\configurations?: list<array{scenarios: string, repository: string}>, Quittio\Core\java?: string, Quittio\Core\timeout?: int, Quittio\Core\fail_on_unavailable?: bool}\|null` | null = disabled |
| `$locale` readonly | `?string` | |
| `$mandatoryFields` readonly | `string` | |
| `$maxDecompressedBytes` readonly | `int` | |
| `$maxPdfBytes` readonly | `int` | |
| `$maxXmlBytes` readonly | `int` | |
| `$options` readonly | `array<string, mixed>` | options for validation rules and the view model |
| `$pdfa` readonly | `bool` | |
| `$presentation` readonly | `[Presentation](https://quittio.dev/docs/api/Quittio/Core/Data/Presentation/Presentation)\|null` | design defaults (logo, colours, texts); the invoice's own values win |
| `$profile` readonly | `string\|null` | default profile for every format that allows it; null = the profile of the format or of the automatic choice (EN 16931 for ZUGFeRD/Factur-X) |
| `$rules` readonly | `[RuleOverrides](https://quittio.dev/docs/api/Quittio/Core/Validation/RuleOverrides)` | PHP rules switched off, re-rated or replaced by code |
| `$tempDir` readonly | `?string` | |
| `$template` readonly | `string` | |
| `$templatePaths` readonly | `list<string>` | directories for plain PHP templates |
| `$validation` readonly | `string` | error (throw on errors), warn (attach result only) or off |
| `$validationLevels` readonly | `list< [ValidationLevel](https://quittio.dev/docs/api/Quittio/Core/Validation/ValidationLevel)>` | levels run while rendering |
| `$validationLocale` readonly | `string\|null` | language of validation messages: null or "invoice" = the language of the invoice, "app" = the language of the application translator (Laravel: app()->getLocale()), or a locale |
| `$veraPdf` readonly | `array{Quittio\Core\mode?: string, Quittio\Core\binary?: string, Quittio\Core\image?: string, Quittio\Core\docker?: string, Quittio\Core\timeout?: int, Quittio\Core\fail_on_unavailable?: bool}\|null` | null = disabled |

## Methods \#

| Method | Description |
| --- | --- |
| `->__construct()` | |
| `::countrySettings()` | The settings of the country packs: the entries with a lower-case code and an array, e.g. 'de' => \['consumer\_default\_notice' => false]; others (e.g. pack classes) are left out. |
| `::fromArray()` | Builds the configuration from an array with the core's own, flat layout (not the layout of the Laravel config/quittio.php). Keys, all optional: |
| `->with()` | |

### `__construct()`#

```
public function __construct(
    string|null $format = null,
    string|null $profile = null,
    ?string $locale = null,
    ?string $country = null,
    string $template = 'default',
    list<string> $templatePaths = [],
    string $filename = '{title}_{number}.{ext}',
    bool $pdfa = true,
    bool $b2cEmbedXml = false,
    bool $autoUpgradeProfile = true,
    string $validation = self::VALIDATION_ERROR,
    list<ValidationLevel> $validationLevels = [\Quittio\Core\Validation\ValidationLevel::L1, \Quittio\Core\Validation\ValidationLevel::L2, \Quittio\Core\Validation\ValidationLevel::L3, \Quittio\Core\Validation\ValidationLevel::L4, \Quittio\Core\Validation\ValidationLevel::L7],
    array{mode?: string, url?: string, jar?: string|null, configurations?: list<array{scenarios: string, repository: string}>, java?: string, timeout?: int, fail_on_unavailable?: bool}|null $kosit = null,
    array{mode?: string, binary?: string, image?: string, docker?: string, timeout?: int, fail_on_unavailable?: bool}|null $veraPdf = null,
    string $mandatoryFields = \Quittio\Core\View\MandatoryFieldGuard::MODE_EXCEPTION,
    string $girocodeAmount = 'due',
    ?string $tempDir = null,
    array<string, mixed> $options = [],
    Presentation|null $presentation = null,
    bool $blockOnWarnings = false,
    int $maxXmlBytes = \Quittio\Core\Xml\XmlSecurity::DEFAULT_MAX_BYTES,
    int $maxPdfBytes = 25 * 1024 * 1024,
    int $maxDecompressedBytes = 50 * 1024 * 1024,
    int|null $dueDays = null,
    string|null $cancellationStrategy = null,
    string|null $validationLocale = null,
    RuleOverrides $rules = new \Quittio\Core\Validation\RuleOverrides(),
    CalculationPolicy $calculation = new \Quittio\Core\Calculation\CalculationPolicy(),
    array<string, array<string, mixed>> $countrySettings = [],
)
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$format` | `string\|null` = `null` | default output format, null = automatic choice |
| `$profile` | `string\|null` = `null` | default profile for every format that allows it; null = the profile of the format or of the automatic choice (EN 16931 for ZUGFeRD/Factur-X) |
| `$locale` | `?string` = `null` | |
| `$country` | `?string` = `null` | |
| `$template` | `string` = `'default'` | |
| `$templatePaths` | `list<string>` = `[]` | directories for plain PHP templates |
| `$filename` | `string` = `'{title}_{number}.{ext}'` | |
| `$pdfa` | `bool` = `true` | |
| `$b2cEmbedXml` | `bool` = `false` | |
| `$autoUpgradeProfile` | `bool` = `true` | |
| `$validation` | `string` = `self::VALIDATION_ERROR` | error (throw on errors), warn (attach result only) or off |
| `$validationLevels` | `list< [ValidationLevel](https://quittio.dev/docs/api/Quittio/Core/Validation/ValidationLevel)>` = `[\Quittio\Core\Validation\ValidationLevel::L1, \Quittio\Core\Validation\ValidationLevel::L2, \Quittio\Core\Validation\ValidationLevel::L3, \Quittio\Core\Validation\ValidationLevel::L4, \Quittio\Core\Validation\ValidationLevel::L7]` | levels run while rendering |
| `$kosit` | `array{Quittio\Core\mode?: string, Quittio\Core\url?: string, Quittio\Core\jar?: string\|null, Quittio\Core\configurations?: list<array{scenarios: string, repository: string}>, Quittio\Core\java?: string, Quittio\Core\timeout?: int, Quittio\Core\fail_on_unavailable?: bool}\|null` = `null` | null = disabled |
| `$veraPdf` | `array{Quittio\Core\mode?: string, Quittio\Core\binary?: string, Quittio\Core\image?: string, Quittio\Core\docker?: string, Quittio\Core\timeout?: int, Quittio\Core\fail_on_unavailable?: bool}\|null` = `null` | null = disabled |
| `$mandatoryFields` | `string` = `\Quittio\Core\View\MandatoryFieldGuard::MODE_EXCEPTION` | |
| `$girocodeAmount` | `string` = `'due'` | |
| `$tempDir` | `?string` = `null` | |
| `$options` | `array<string, mixed>` = `[]` | options for validation rules and the view model |
| `$presentation` | `[Presentation](https://quittio.dev/docs/api/Quittio/Core/Data/Presentation/Presentation)\|null` = `null` | design defaults (logo, colours, texts); the invoice's own values win |
| `$blockOnWarnings` | `bool` = `false` | |
| `$maxXmlBytes` | `int` = `\Quittio\Core\Xml\XmlSecurity::DEFAULT_MAX_BYTES` | |
| `$maxPdfBytes` | `int` = `25 * 1024 * 1024` | |
| `$maxDecompressedBytes` | `int` = `50 * 1024 * 1024` | |
| `$dueDays` | `int\|null` = `null` | due date (BT-9) = issue date + days for invoices without due date and payment terms |
| `$cancellationStrategy` | `string\|null` = `null` | credit\_note or negative\_invoice; null = default of the country pack |
| `$validationLocale` | `string\|null` = `null` | language of validation messages: null or "invoice" = the language of the invoice, "app" = the language of the application translator (Laravel: app()->getLocale()), or a locale |
| `$rules` | `[RuleOverrides](https://quittio.dev/docs/api/Quittio/Core/Validation/RuleOverrides)` = `new \Quittio\Core\Validation\RuleOverrides()` | PHP rules switched off, re-rated or replaced by code |
| `$calculation` | `[CalculationPolicy](https://quittio.dev/docs/api/Quittio/Core/Calculation/CalculationPolicy)` = `new \Quittio\Core\Calculation\CalculationPolicy()` | what the calculator does with declared amounts |
| `$countrySettings` | `array<string, array<string, mixed>>` = `[]` | settings of the country packs by lower-case code, e.g. \['de' => \['consumer\_default\_notice' => false]] (Laravel: quittio.countries.de) |

### `countrySettings()`#

```
public static function countrySettings(
    array<array-key, mixed> $countries,
): array<string, array<string, mixed>>
```

static

The settings of the country packs: the entries with a lower-case code and an array, e.g. 'de' => \['consumer\_default\_notice' => false]; others (e.g. pack classes) are left out.

| Parameter | Type | Description |
| --- | --- | --- |
| `$countries` | `array<array-key, mixed>` | |

<dl><dt>Returns</dt>
<dd><code>array&lt;string, array&lt;string, mixed&gt;&gt;</code></dd>
</dl>

### `fromArray()`#

```
public static function fromArray(array<string, mixed> $config): self
```

static

Builds the configuration from an array with the core's own, flat layout (not the layout of the Laravel config/quittio.php). Keys, all optional:

- format ("auto" or null = automatic choice), profile, locale, country, due\_days
- template, template\_paths (directories with {name}.php), filename
- pdf.pdfa, pdf.b2c\_embed\_xml, pdf.girocode\_amount (due, discounted)
- auto\_upgrade\_profile
- validation.mode (error, warn, off), validation.levels (enum names L1 … L7, e.g. \['L1', 'L4']), validation.block\_on\_warnings, validation.rules (disabled, severity, allow\_official; see RuleOverrides)
- validation.kosit, validation.verapdf: \['enabled' => true, …] switches the driver on; the other keys are those of the $kosit and $veraPdf parameters (KoSIT scenario sets only in "configurations")
- mandatory\_fields (exception, log, off), temp\_dir, options (e.g. paper, markdown, fold\_marks, watermark)
- presentation (a Presentation object)
- reader.max\_xml\_bytes, reader.max\_pdf\_bytes, reader.max\_decompressed\_bytes
- corrections.cancellation\_strategy
- countries.{code}: settings of a country pack, e.g. countries.de.consumer\_default\_notice
- calculation.declared\_amounts (keep, recalculate, reject; see DeclaredAmountsMode)

The Laravel names differ, e.g. defaults.format, format\_resolver.b2c\_embed\_xml, validation.levels php/xsd/kosit/verapdf, validation.mandatory\_field\_guard and pdf.cache\_path.

| Parameter | Type | Description |
| --- | --- | --- |
| `$config` | `array<string, mixed>` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `with()`#

```
public function with(array<string, mixed> $changes): self
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$changes` | `array<string, mixed>` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/Config#webpage","@type":"WebPage","description":"Configuration of the core without Laravel. The Laravel package translates config/quittio.php into it (Quittio\\Laravel\\Support\\ConfigMapper), whose layout differs from the keys of fromArray().","name":"Config – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Config","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Config"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```