socialdept/atp-schema
| Install | |
|---|---|
composer require socialdept/atp-schema |
|
| Latest Version: | v0.4.12 |
| PHP: | ^8.3 |
| Laravel: | 11 · 12 · 13 |
| License: | MIT |
| Last Updated: | Nov 7, 2026 |
| Links: | GitHub · Packagist |
Parse, validate, and transform AT Protocol Lexicon schemas in Laravel.
This package loads AT Protocol lexicons into a Laravel app, validates records against them, ships PHP classes for the standard AT Protocol and Bluesky lexicons, generates classes for any other lexicon, and gives you commands to create, lint and check lexicons of your own before you publish them. To learn all about it, head over to the documentation.
Here are a few short examples of what you can do. Validate a record against a lexicon:
use SocialDept\AtpSchema\Facades\Schema;
Schema::validate('app.bsky.feed.post', [
'text' => 'Hello, AT Protocol!',
'createdAt' => '2024-01-01T12:00:00Z',
]); // true
Build records with the bundled classes:
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Post;
$post = new Post(text: 'Hello ATP!', createdAt: now());
$post->toRecord(); // ['text' => 'Hello ATP!', 'createdAt' => '...', '$type' => 'app.bsky.feed.post']
Generate classes for any lexicon:
php artisan schema:generate app.bsky.feed.post --with-dependencies
Write lexicons of your own, and check them before you publish:
php artisan schema:new record com.example.thing
php artisan schema:lint
php artisan schema:breaking
Documentation
You'll find the documentation on https://socialde.pt/docs/atp-schema.
Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving it? Feel free to create an issue on GitHub.
Testing
vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see LICENSE for more information.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.4.12 | ^8.3 | ^11.0| | MIT | |
| v0.4.11 | ^8.3 | ^11.0| | MIT | |
| v0.4.10 | ^8.3 | ^11.0| | MIT | |
| v0.4.9 | ^8.3 | ^11.0| | MIT | |
| v0.4.8 | ^8.3 | ^11.0| | MIT | |
| v0.4.7 | ^8.3 | ^11.0| | MIT | |
| v0.4.6 | ^8.3 | ^11.0| | MIT | |
| v0.4.5 | ^8.3 | ^11.0| | MIT | |
| v0.4.4 | ^8.2 | ^11.0| | MIT | |
| v0.4.3 | ^8.2 | ^11.0| | MIT | |
| v0.4.2 | ^8.2 | ^11.0| | MIT | |
| v0.4.1 | ^8.2 | ^11.0| | MIT | |
| v0.4.0 | ^8.2 | ^11.0| | MIT | |
| v0.3.6 | ^8.2 | ^11.0| | MIT | |
| v0.3.5 | ^8.2 | ^11.0| | MIT | |
| v0.3.4 | ^8.2 | ^11.0| | MIT | |
| v0.3.3 | ^8.2 | ^11.0| | MIT | |
| v0.3.2 | ^8.2 | ^11.0| | MIT | |
| v0.3.1 | ^8.2 | ^11.0| | MIT | |
| v0.3.0 | ^8.2 | ^11.0| | MIT | |
| v0.2.1 | ^8.2 | ^11.0| | MIT | |
| v0.2.0 | ^8.2 | ^11.0| | MIT | |
| v0.1.0 | ^8.2 | ^11.0| | MIT |
