Skip to content

v5.1.0 - GOBL support

Choose a tag to compare

@QuentinGab QuentinGab released this 27 Jun 15:04

Added

  • Initial GOBL support — New ‎⁠GOBLable⁠ contract with ‎⁠toGOBL()⁠ method. ‎⁠Address⁠, ‎⁠Party⁠, ‎⁠Identity⁠, and ‎⁠TaxId⁠ classes implement it, enabling conversion to the GOBL (https://docs.gobl.org) open standard for structured business documents.

  • New ‎⁠Party⁠ base class — ‎⁠Buyer⁠ and ‎⁠Seller⁠ now extend a shared ‎⁠Party⁠ class, reducing duplication. Both subclasses are preserved for type compatibility.

  • New ‎⁠TaxId⁠ value object — Structured tax identification with ‎⁠country⁠ and ‎⁠code⁠ properties, replacing the flat ‎⁠tax_number⁠ string. Displayed via ‎⁠getLabel()⁠ in PDF templates.

  • New ‎⁠Identity⁠ value object — Represents business identities (e.g. SIREN, SIRET) following the GOBL org/identity spec (https://docs.gobl.org/draft-0/org/identity). Identities are now rendered in the PDF party block.

  • Configurable support classes — New config keys: ‎⁠party_class⁠, ‎⁠identity_class⁠, ‎⁠address_class⁠, ‎⁠tax_id_class⁠ let you swap default implementations.

  • ‎⁠seller_information⁠ and ‎⁠buyer_information⁠ are now cast to ‎⁠Party⁠ objects instead of plain arrays on the ‎⁠Invoice⁠ model.

Breaking Changes

  • ‎⁠tax_number⁠ → ‎⁠tax_id⁠: The ‎⁠tax_number⁠ string on ‎⁠Seller⁠/‎⁠Buyer⁠ has been replaced by a ‎⁠TaxId⁠ object.

Config:
update ‎⁠default_seller⁠:

Before

'tax_number' => 'FR123456789',

After

'tax_id' => [
    'country' => 'FR',
    'code' => '123456789',
],

PdfInvoice — use the new ‎⁠TaxId⁠ class:

Before

tax_number: 'FR123456789',

After

tax_id: new TaxId(country: 'FR', code: '123456789'),
  • Migration required — A migration is included to convert existing ‎⁠tax_number⁠ values in ‎⁠buyer_information⁠ and ‎⁠seller_information⁠ JSON columns. Publish and run it:php artisan vendor:publish --tag="invoices-migrations"

php artisan migrate

  • ‎⁠Buyer⁠/‎⁠Seller⁠ replaced by ⁠Party⁠.