spatie/schema-org
Fluent PHP builder for the full Schema.org vocabulary. Create Schema.org types and properties via chainable methods and output valid JSON-LD/ld+json scripts for SEO. Auto-generated from Schema.org standards for complete coverage.
Requires PHP 8.4. Support for PHP 8.2 and 8.3 has been dropped.
Quantity is gone. schema.org v30.0 reclassified Quantity as a DataType (like Text and Number), so it is no longer generated as a class. Spatie\SchemaOrg\Quantity, Contracts\QuantityContract and Schema::quantity() have been removed.
Distance, Duration, Energy and Mass lost their inherited properties. Because their only parent was Quantity, they no longer declare the twelve Thing properties (name, description, url, identifier, …) and no longer implement ThingContract, IntangibleContract or QuantityContract. Calls like Schema::distance()->name('…') still work at runtime through BaseType::__call, but static analysis, IDE completion and instanceof checks against those contracts will not.
Thirteen new types: AuthenticateAction, ConferenceEvent, Credential, DENonprofitType, Error, ITNonprofitType, InstantaneousEvent, LoginAction, OperatingSystem, PerformingArtsEvent, ResetPasswordAction, RuntimePlatform, SequentialArt.
Full Changelog: https://github.com/spatie/schema-org/compare/4.0.2...5.0.0
Backport of the </script> break-out fix (#242) onto the 3.x line, so projects still on spatie/schema-org 3.x can apply the security patch without upgrading to 4.x.
toScript() now adds JSON_HEX_TAG to the json_encode flags. 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: https://github.com/spatie/schema-org/compare/3.23.1...3.23.2
toScript() output to prevent script break-out by @freekmurze in https://github.com/spatie/schema-org/pull/242Values 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
Full Changelog: https://github.com/spatie/schema-org/compare/4.0.0...4.0.1
JSON_UNESCAPED_SLASHES to toScript() outputFull Changelog: https://github.com/spatie/schema-org/compare/3.23.0...3.23.1
Full Changelog: https://github.com/spatie/schema-org/compare/3.22.0...3.23.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.21.0...3.22.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.20.0...3.21.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.19.0...3.20.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.18.0...3.19.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.17.0...3.18.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.16.0...3.17.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.15.0...3.16.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.14.0...3.15.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.13.0...3.14.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.12.0...3.13.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.11.0...3.12.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.10.0...3.11.0
Full Changelog: https://github.com/spatie/schema-org/compare/3.8.0...3.9.0
\Spatie\SchemaOrg\Graph context support - #160[@id](https://github.com/id) and identifier serialization for typed identifiers - #157\Spatie\SchemaOrg\ReferencedType to reference types in schemas and graphs - #155\Spatie\SchemaOrg\MultiTypedEntity - #148Generated 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.
How can I help you explore Laravel packages today?