yu-laravel / schema-validator
Laravel Livewire tool that validates Schema.org structured data (JSON-LD and microdata) and rich result requirements.
Package info
github.com/yuriyakishin/laravel-schema-validator
pkg:composer/yu-laravel/schema-validator
Requires
- php: ^8.4
- ext-mbstring: *
- laravel/framework: ^13.0
- livewire/livewire: ^4.0
- yu-laravel/web-tools-core: ^1.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-19 11:17:51 UTC
README
A Livewire tool for Laravel that validates a page's Schema.org structured data and checks whether Google can build rich results from it. It reads JSON-LD (including @graph and @id references) and microdata. It shows the markup as a tree, checks types and value formats against the Schema.org vocabulary, and suggests the right name for a misspelled type.
🔗 Live example: yu.net.ua/en/tools/schema-validator
What it checks
12 checks in two groups. The result is a score out of 100 and a verdict.
| Group | Checks |
|---|---|
| Is the markup readable? | Structured data present, Schema.org vocabulary, real types, value formats |
| Google rich results | Organization, WebSite name, BreadcrumbList, Product, rating stars, Article, FAQ, Event |
A rich result check is skipped, and doesn't lower the score, when its type isn't on the page.
Requirements
- PHP ^8.4
- Laravel ^13.0
- Livewire ^4.0
Installation
composer require yu-laravel/schema-validator
This also installs yu-laravel/web-tools-core. Both service providers are discovered automatically.
Usage
Put the component on a page whose layout includes @livewireStyles and @livewireScripts:
<livewire:schema-validator />
Import the styles into your CSS build:
@import "../../vendor/yu-laravel/web-tools-core/resources/css/web-tools-core.css"; @import "../../vendor/yu-laravel/schema-validator/resources/css/schema-validator.css";
To match your site's colours and fonts, override the --wt-* variables (see Web Tools Core).
Configuration
| Env variable | Default | Description |
|---|---|---|
SCHEMA_VALIDATOR_ENABLED |
true |
Turn the tool off without uninstalling it. |
SCHEMA_VALIDATOR_PER_HOUR |
10 |
Checks per visitor IP per hour. |
A report is cached for 2 minutes, so a fix shows up on the next check. config/schema-validator.php also limits the page size (5 MB). Page fetching (timeouts, redirects, user agent) is set in Web Tools Core.
The Schema.org types and their parents are stored in resources/vocabulary/types.php. That file was generated from the official schemaorg-current-https-types.csv; regenerate it when Schema.org releases a new version.
Events
After every check the tool dispatches Yu\WebToolsCore\Events\ToolCheckedEvent with tool = "schema-validator" (see Listening to checks).
Languages
13 translations: cs, de, en, es, fr, it, ja, nl, pl, pt, tr, uk and zh. The language is taken from the visitor's browser, with your app locale as the fallback.
Limitations
The tool reads the HTML the server returns. It doesn't see markup that JavaScript adds after the page loads.
Author
Yuriy Akishin:
- 🌐 Website: https://yu.net.ua
- 📧 Email: yuriy.akishin@gmail.com
- 💼 LinkedIn: https://www.linkedin.com/in/yuriyakishin/
- 💻 GitHub: https://github.com/yuriyakishin
License
MIT. See LICENSE.
