spatie/schema-org
A fluent builder Schema.org types and ld+json generator
5.0.0
12M downloads/mo
#1225 most downloaded on Packagist
spatie/schema-org
What this package is like to depend on
Last release 16 days ago
07 Aug 2026
Release timing varies
gaps range from 3 weeks to 13 months
Nearly every release is documented
notes for 67 of 69 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
69 releases · first in 2016
5 releases in the last 12 months
see the full history below
Release timeline
69 releases · Dec 2016 to Aug 2026Releases
latest 60 of 69-
5.0.007 Aug 2026Release notes
Open source →Breaking changes
Requires PHP 8.4. Support for PHP 8.2 and 8.3 has been dropped.
Quantityis gone. schema.org v30.0 reclassifiedQuantityas a DataType (likeTextandNumber), so it is no longer generated as a class.Spatie\SchemaOrg\Quantity,Contracts\QuantityContractandSchema::quantity()have been removed.Distance,Duration,EnergyandMasslost their inherited properties. Because their only parent wasQuantity, they no longer declare the twelveThingproperties (name,description,url,identifier, …) and no longer implementThingContract,IntangibleContractorQuantityContract. Calls likeSchema::distance()->name('…')still work at runtime throughBaseType::__call, but static analysis, IDE completion andinstanceofchecks against those contracts will not.Other changes
Thirteen new types:
AuthenticateAction,ConferenceEvent,Credential,DENonprofitType,Error,ITNonprofitType,InstantaneousEvent,LoginAction,OperatingSystem,PerformingArtsEvent,ResetPasswordAction,RuntimePlatform,SequentialArt.What's Changed
- Upgrade schema.org definitions to v30.0 by @endelwar in #244
- Keep the ReferencedType generator template in sync with src by @freekmurze in #246
- Upgrade test suite to Pest 5 by @freekmurze in #245
New Contributors
Full Changelog: 4.0.2...5.0.0
Release notes
Open source →Breaking changes
Requires PHP 8.4. Support for PHP 8.2 and 8.3 has been dropped.
Quantityis gone. schema.org v30.0 reclassifiedQuantityas a DataType (likeTextandNumber), so it is no longer generated as a class.Spatie\SchemaOrg\Quantity,Contracts\QuantityContractandSchema::quantity()have been removed.Distance,Duration,EnergyandMasslost their inherited properties. Because their only parent wasQuantity, they no longer declare the twelveThingproperties (name,description,url,identifier, …) and no longer implementThingContract,IntangibleContractorQuantityContract. Calls likeSchema::distance()->name('…')still work at runtime throughBaseType::__call, but static analysis, IDE completion andinstanceofchecks against those contracts will not.Other changes
Thirteen new types:
AuthenticateAction,ConferenceEvent,Credential,DENonprofitType,Error,ITNonprofitType,InstantaneousEvent,LoginAction,OperatingSystem,PerformingArtsEvent,ResetPasswordAction,RuntimePlatform,SequentialArt.What's Changed
- Upgrade schema.org definitions to v30.0 by @endelwar in https://github.com/spatie/schema-org/pull/244
- Keep the ReferencedType generator template in sync with src by @freekmurze in https://github.com/spatie/schema-org/pull/246
- Upgrade test suite to Pest 5 by @freekmurze in https://github.com/spatie/schema-org/pull/245
New Contributors
- @endelwar made their first contribution in https://github.com/spatie/schema-org/pull/244
Full Changelog: https://github.com/spatie/schema-org/compare/4.0.2...5.0.0
-
4.0.220 Apr 2026Release notes
Open source →What's Changed
- Escape HTML tags in
toScript()output to prevent script break-out by @freekmurze in #242
Values containing
</script>passed as schema properties could break out of the generated<script type="application/ld+json">block and execute injected HTML when the value was attacker-controlled.toScript()now emits<and>as\u003C/\u003E, which is valid JSON-LD and is no longer parsed as an HTML tag by the browser. Affects 3.23.1 through 4.0.1.Full Changelog: 4.0.1...4.0.2
Release notes
Open source →What's Changed
- Escape HTML tags in
toScript()output to prevent script break-out by @freekmurze in https://github.com/spatie/schema-org/pull/242
Values containing
</script>passed as schema properties could break out of the generated<script type="application/ld+json">block and execute injected HTML when the value was attacker-controlled.toScript()now emits<and>as\u003C/\u003E, which is valid JSON-LD and is no longer parsed as an HTML tag by the browser. Affects 3.23.1 through 4.0.1.Full Changelog: https://github.com/spatie/schema-org/compare/4.0.1...4.0.2
- Escape HTML tags in
-
4.0.116 Apr 2026Release notes
Open source →What's Changed
- Resolve @id without cascading toArray() in ReferencedType by @freekmurze in #241
Full Changelog: 4.0.0...4.0.1
Release notes
Open source →What's Changed
- Resolve @id without cascading toArray() in ReferencedType by @freekmurze in https://github.com/spatie/schema-org/pull/241
Full Changelog: https://github.com/spatie/schema-org/compare/4.0.0...4.0.1
-
4.0.009 Feb 2026Release notes
Open source →What's Changed
- Upgrade schema.org definitions to v29.3 (#238 by @Soean)
- Drop PHP 8.0 and 8.1 support (now requires PHP ^8.2)
- Add PHP 8.5 support
- Add
JSON_UNESCAPED_SLASHEStotoScript()output - Upgrade dev dependencies (Pest 2/3, PHPUnit 10, Symfony 6/7)
- Upgrade phpunit.xml.dist to PHPUnit 10 format
- Add return type declarations to generator commands
Release notes
Open source →What's Changed
- Upgrade schema.org definitions to v29.3 (#238 by @Soean)
- Drop PHP 8.0 and 8.1 support (now requires PHP ^8.2)
- Add PHP 8.5 support
- Add
JSON_UNESCAPED_SLASHEStotoScript()output - Upgrade dev dependencies (Pest 2/3, PHPUnit 10, Symfony 6/7)
- Upgrade phpunit.xml.dist to PHPUnit 10 format
- Add return type declarations to generator commands
-
3.23.229 May 2026Release notes
Open source →What's Changed
Backport of the
</script>break-out fix (#242) onto the 3.x line, so projects still onspatie/schema-org3.x can apply the security patch without upgrading to 4.x.toScript()now addsJSON_HEX_TAGto thejson_encodeflags. The<and>characters in property values are now serialized as their JSON unicode escapes instead of raw angle brackets, which is valid JSON-LD but cannot be parsed as an HTML tag. This neutralizes the break-out vector reported in the advisory (affected: 3.23.1 through 4.0.1).Thanks to @hacklian for reporting (#243) and supplying the backport patch.
Full Changelog: 3.23.1...3.23.2
Release notes
Open source →What's Changed
Backport of the
</script>break-out fix (#242) onto the 3.x line, so projects still onspatie/schema-org3.x can apply the security patch without upgrading to 4.x.toScript()now addsJSON_HEX_TAGto thejson_encodeflags, so<and>in property values are serialized as</>. This is valid JSON-LD but cannot be parsed as an HTML tag, neutralizing the break-out vector reported in the advisory (affected: 3.23.1 through 4.0.1).Thanks to @hacklian for reporting (#243) and supplying the backport patch.
Full Changelog: https://github.com/spatie/schema-org/compare/3.23.1...3.23.2
-
3.23.131 Jan 2025Release notes
Open source →What's Changed
- Unescape slashes in output by @patrickomeara in #223
- Update graham-campbell/analyzer by @freekmurze in #224
- Upgrade to schema.org v28.1 by @Soean in #222
New Contributors
- @patrickomeara made their first contribution in #223
- @Soean made their first contribution in #222
Full Changelog: 3.23.0...3.23.1
Release notes
Open source →What's Changed
- Unescape slashes in output by @patrickomeara in https://github.com/spatie/schema-org/pull/223
- Update graham-campbell/analyzer by @freekmurze in https://github.com/spatie/schema-org/pull/224
- Upgrade to schema.org v28.1 by @Soean in https://github.com/spatie/schema-org/pull/222
New Contributors
- @patrickomeara made their first contribution in https://github.com/spatie/schema-org/pull/223
- @Soean made their first contribution in https://github.com/spatie/schema-org/pull/222
Full Changelog: https://github.com/spatie/schema-org/compare/3.23.0...3.23.1
-
3.23.011 Jan 2024Release notes
Open source →What's Changed
- Update generator to use schema v24 by @indyjonesnl in #201
- Schema 24 by @Gummibeer in #213
New Contributors
- @indyjonesnl made their first contribution in #201
Full Changelog: 3.22.0...3.23.0
Release notes
Open source →What's Changed
- Update generator to use schema v24 by @indyjonesnl in https://github.com/spatie/schema-org/pull/201
- Schema 24 by @Gummibeer in https://github.com/spatie/schema-org/pull/213
New Contributors
- @indyjonesnl made their first contribution in https://github.com/spatie/schema-org/pull/201
Full Changelog: https://github.com/spatie/schema-org/compare/3.22.0...3.23.0
-
3.22.011 Jan 2024Release notes
Open source →Release notes
Open source →What's Changed
- upgrade to schema.org v23 by @Gummibeer in https://github.com/spatie/schema-org/pull/212
Full Changelog: https://github.com/spatie/schema-org/compare/3.21.0...3.22.0
-
3.21.011 Jan 2024Release notes
Open source →Release notes
Open source →What's Changed
- upgrade to schema.org v22 by @Gummibeer in https://github.com/spatie/schema-org/pull/211
Full Changelog: https://github.com/spatie/schema-org/compare/3.20.0...3.21.0
-
3.20.011 Jan 2024Release notes
Open source →Release notes
Open source →What's Changed
- upgrade to schema.org v21 by @Gummibeer in https://github.com/spatie/schema-org/pull/210
Full Changelog: https://github.com/spatie/schema-org/compare/3.19.0...3.20.0
-
3.19.011 Jan 2024Release notes
Open source →What's Changed
- upgrade to schema.org v20 by @Gummibeer in https://github.com/spatie/schema-org/pull/209
Full Changelog: https://github.com/spatie/schema-org/compare/3.18.0...3.19.0
-
3.18.011 Jan 2024Release notes
Open source →What's Changed
- upgrade to schema.org v19 by @Gummibeer in https://github.com/spatie/schema-org/pull/208
Full Changelog: https://github.com/spatie/schema-org/compare/3.17.0...3.18.0
-
3.17.011 Jan 2024Release notes
Open source →What's Changed
- upgrade to schema.org v18 by @Gummibeer in https://github.com/spatie/schema-org/pull/207
Full Changelog: https://github.com/spatie/schema-org/compare/3.16.0...3.17.0
-
3.16.011 Jan 2024Release notes
Open source →What's Changed
- upgrade to schema.org v17 by @Gummibeer in https://github.com/spatie/schema-org/pull/206
Full Changelog: https://github.com/spatie/schema-org/compare/3.15.0...3.16.0
-
3.15.011 Jan 2024Release notes
Open source →What's Changed
- upgrade to schema.org v16 by @Gummibeer in https://github.com/spatie/schema-org/pull/204
- add support/test-run for php8.3 by @Gummibeer in https://github.com/spatie/schema-org/pull/205
Full Changelog: https://github.com/spatie/schema-org/compare/3.14.0...3.15.0
-
3.14.014 Feb 2023Release notes
Open source →What's Changed
- Add PHP 8.2 Support by @patinthehat in https://github.com/spatie/schema-org/pull/190
- Add support for nonce attribute by @smortexa in https://github.com/spatie/schema-org/pull/191
New Contributors
- @patinthehat made their first contribution in https://github.com/spatie/schema-org/pull/190
- @smortexa made their first contribution in https://github.com/spatie/schema-org/pull/191
Full Changelog: https://github.com/spatie/schema-org/compare/3.13.0...3.14.0
-
3.13.014 Nov 2022Release notes
Open source →What's Changed
- add support for complex context by @Gummibeer in https://github.com/spatie/schema-org/pull/189
Full Changelog: https://github.com/spatie/schema-org/compare/3.12.0...3.13.0
-
3.12.014 Nov 2022Release notes
Open source →What's Changed
- Update generator to use schema v15 by @osopolar in https://github.com/spatie/schema-org/pull/188
New Contributors
- @osopolar made their first contribution in https://github.com/spatie/schema-org/pull/188
Full Changelog: https://github.com/spatie/schema-org/compare/3.11.0...3.12.0
-
3.11.011 Apr 2022Nothing published for this version
-
3.10.004 Mar 2022 -
3.9.010 Feb 2022 -
3.8.020 Oct 2021 -
3.7.006 Oct 2021 -
3.6.006 Oct 2021 -
3.5.005 Oct 2021Release notes
Open source → -
3.4.010 May 2021 -
3.3.002 Jan 2021 -
3.2.128 Nov 2020 -
3.2.005 Nov 2020Release notes
Open source →- Add
\Spatie\SchemaOrg\ReferencedTypeto reference types in schemas and graphs - #155
- Add
-
3.1.122 Oct 2020 -
3.1.007 Oct 2020Release notes
Open source →- Add Multi-Typed-Entity support
\Spatie\SchemaOrg\MultiTypedEntity- #148
- Add Multi-Typed-Entity support
-
3.0.027 Aug 2020 -
2.16.027 Aug 2020 -
2.15.027 Aug 2020Release notes
Open source →Generated files with new JSON-LD source - some methods have been dropped which aren't part of the corresponding types but were listed in old RDFa - it's not a breaking release because of the same schema.org version and changes only because of schema file inconsistencies.
-
2.14.110 Jun 2020Release notes
Open source →- Fix
\BadMethodCallExceptionmessage thrown in\Spatie\SchemaOrg\Graph - Fix
\Spatie\SchemaOrg\Graphdocblock@methodannotations
- Fix
-
2.14.003 Jun 2020 -
2.13.017 Apr 2020 -
2.12.117 Mar 2020 -
2.12.023 Jan 2020 -
2.11.118 Nov 2019 -
2.11.018 Nov 2019 -
2.10.012 Nov 2019 -
2.9.006 Oct 2019 -
2.8.006 Oct 2019 -
2.7.006 Oct 2019 -
2.6.026 Sep 2019 -
2.5.025 Sep 2019 -
2.4.025 Sep 2019 -
2.3.007 Aug 2019 -
2.2.128 May 2019 -
2.2.028 May 2019 -
2.1.018 Jan 2019 -
2.0.317 Oct 2018 -
2.0.225 Jun 2018 -
2.0.125 Jun 2018 -
2.0.008 Jun 2018Release notes
Open source →- Supports multiple type inheritance. Types no longer extend each other, they all are a direct extension of
BaseType - This release probably doesn't contain any breaking changes for most people. It breaks all type checks (e.g.
instanceof LocalBusiness), but doesn't change the way types are generated
- Supports multiple type inheritance. Types no longer extend each other, they all are a direct extension of
-
1.7.008 Jun 2018 -
1.6.022 May 2018Release notes
Open source →- Added:
Enumerationchild types with constants, e.g.Spatie\Schema\DayOfWeek::Monday.
- Added:
-
1.5.003 May 2018 -
1.4.228 Mar 2018