Download the PHP package inesta/php-schemas without Composer
On this page you can find all versions of the php package inesta/php-schemas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inesta/php-schemas
More information about inesta/php-schemas
Files in inesta/php-schemas
Package php-schemas
Short Description A fluent, type-safe PHP library for creating Schema.org structured data (JSON-LD, Microdata, RDFa)
License MIT
Homepage https://github.com/inesta/php-schemas
Informations about the package php-schemas
PHP Schema.org Library
A modern, type-safe PHP library for creating Schema.org structured data with fluent interfaces and comprehensive validation. Generate JSON-LD, Microdata, and RDFa markup to improve SEO and enable rich snippets.
Features
🛡️ Type Safety First
- Every Schema.org type is a strongly-typed PHP class
- Full PHPStan Level 9 compliance
- Rich IDE autocomplete and error detection
🔄 Immutable Objects
- All schema objects are immutable by design
- Modifications return new instances
- Thread-safe and predictable behavior
🔧 Fluent Interface
- Builder pattern with chainable methods
- Intuitive and readable API
- IDE-friendly method chaining
📊 Multiple Output Formats
- JSON-LD - Perfect for search engines and rich snippets
- Microdata - Inline HTML markup with schema data
- RDFa - Semantic web standard markup
✅ Comprehensive Validation
- Built-in Schema.org compliance checking
- Pluggable validation rules system
- Required property validation
- Type safety validation
🎯 Framework Integration
- Laravel service provider and facades
- Symfony bundle support
- PSR-4 autoloading compatible
Installation
Install via Composer:
Requirements
- PHP 8.3 or higher
- JSON extension
- mbstring extension (recommended)
⚡ Performance Features
- Schema Caching - Automatic caching for frequently used schemas
- Lazy Loading - Defer schema creation until actually needed
- Memory Optimization - Efficient memory usage for large schema collections
- Benchmarking Tools - Built-in performance measurement utilities
Quick Start
Basic Usage
Using Builders (Recommended)
Rendering Output
JSON-LD (Recommended for SEO)
Output:
Microdata
Output:
RDFa
Validation
The library includes a comprehensive validation system:
Supported Schema Types
Currently supported Schema.org types:
- Thing - Base type for all schemas
- Article - News articles, blog posts, etc.
- Person - Individual people
- Organization - Companies, institutions, etc.
More types coming soon! The library is designed to be easily extensible.
Advanced Usage
Custom Validation Rules
Framework Integration
Laravel
Symfony
Testing
Run the test suite:
Quality Assurance
This project maintains high code quality standards:
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
Development Setup
- Clone the repository
- Install dependencies:
composer install - Run tests:
composer test - Check code quality:
composer check-all
Security
Please review our Security Policy for reporting vulnerabilities.
Changelog
See CHANGELOG.md for version history and changes.
License
This project is licensed under the MIT License - see LICENSE.md for details.
Acknowledgments
- Schema.org for the vocabulary specification
- The PHP community for excellent tooling and standards
- All contributors to this project
Credits
- Roel Veldhuizen
- Inesta.nl
- All Contributors
Need help? Check out our open an issue.
All versions of php-schemas with dependencies
ext-json Version *
ext-mbstring Version *