- How do I install webnuvola/laravel-json-ld?
- Install it with composer require webnuvola/laravel-json-ld. Laravel package auto-discovery registers the service provider, so no manual bootstrap edits are normally needed. Confirm your application meets the v2.2.0 platform requirements of PHP 8.3 or newer and Laravel 10 or newer before installing.
- Which Laravel and PHP versions does laravel-json-ld support?
- Version 2.2.0 supports PHP 8.3, 8.4 and 8.5, and Laravel 10, 11, 12 and 13. It dropped PHP 8.1 and 8.2 plus Laravel 9, which remain on the 2.1.x line. Treat the drop as a breaking platform change even though it shipped as a minor release.
- What is the difference between laravel-json-ld and torann/json-ld?
- This package is a Laravel integration for torann/json-ld rather than a replacement for it. It lets you build Schema.org structured data with a fluent API inside a Laravel application and output it as JSON-LD markup. Use this package when you want torann/json-ld capabilities wired into Laravel conventions.
- How do I output JSON-LD in a Blade view?
- Build the schema with the fluent API, render the JSON-LD string, and place it inside a script tag with type application/ld+json. Use Blade's unescaped output syntax, such as {!! $jsonLd !!}, so the JSON is not HTML-escaped. Keep the script where search engines can crawl it, typically in the page head or body.
- Do I need to publish a config file for laravel-json-ld?
- The package is designed as a thin Laravel wrapper, so most applications can start with defaults. If you need to adjust package behaviour, publish any provided configuration with php artisan vendor:publish and choose the matching webnuvola/laravel-json-ld entry. Check the package README for the exact publish tag, as tags can vary between releases.
- How do I test and validate JSON-LD output from Laravel?
- In a feature test, assert the response contains application/ld+json and decode the script contents with json_decode to check @type and expected properties. In production, run a page through Google's Rich Results Test or the Schema.org validator. This catches malformed JSON, missing required fields and HTML escaping issues.
- Why is Composer still installing version 2.1.x instead of 2.2.0?
- On PHP 8.1 or 8.2, Composer silently resolves to the newest compatible 2.1.x release because 2.2.0 requires PHP 8.3 or newer. Run composer show webnuvola/laravel-json-ld to confirm the installed version and check your lock file. Do not assume composer update moved you to 2.2.0.
- Is the 2.1.x line still maintained with security fixes?
- The v2.2.0 release notes do not state a backport or security-patching policy for the 2.1.x line. Ask the maintainer directly whether 2.1.x still receives security fixes and what its end-of-support date is. Treat 2.1.x as unsupported until you have a written commitment.
- Is version 2.2.0 a breaking change despite being a minor release?
- Effectively yes. Although 2.2.0 is a minor version and the release notes say API, config, schema and behaviour are unchanged, it drops PHP 8.1 and 8.2 plus Laravel 9. For planning, treat it as a breaking platform change and update CI matrices and dependency policies accordingly.
- Can I use laravel-json-ld with Laravel 9 or PHP 8.1?
- For Laravel 9 or PHP 8.1 and 8.2 applications, stay on the 2.1.x line or upgrade the host application to Laravel 10 or newer and PHP 8.3 or newer. If you cannot upgrade, consider using torann/json-ld directly or another maintained structured-data package. Laravel 9 is end of life, so upgrading is the better long-term path.