New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

socialdept/atp-schema

ATProto Lexicon parser and validator with DTO generation for Laravel
2,926
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
Maintainer: socialdept

Schema Header

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

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

660,512,042 9,702
laravel/framework

The Laravel Framework.

625,568,548 34,998
laravel/tinker

Powerful REPL for the Laravel framework.

531,591,559 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

450,320,528 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

418,503,470 4,663

Version History

Version Released PHP Laravel License
v0.4.12 ^8.3 ^11.0|^12.0|^13.0 MIT
v0.4.11 ^8.3 ^11.0|^12.0|^13.0 MIT
v0.4.10 ^8.3 ^11.0|^12.0|^13.0 MIT
v0.4.9 ^8.3 ^11.0|^12.0|^13.0 MIT
v0.4.8 ^8.3 ^11.0|^12.0|^13.0 MIT