socialdept/atp-schema
PHP package for working with AT Protocol (ATProto/Bluesky) schemas, offering generated classes and tooling for Lexicon definitions, validation, and type-safe access to records, requests, and responses in Laravel or standalone PHP applications.
This package provides AT Protocol schema/lexicon handling for Laravel applications. The v0.3.0 release is a namespace-only breaking change: all classes moved from SocialDept\Schema to SocialDept\AtpSchema.
Minimal upgrade/first-use steps:
composer.json still references the old package.SocialDept\Schema\... to SocialDept\AtpSchema\....composer dump-autoload
php artisan config:clear
php artisan cache:clear
Where to look first:
src/ for the schema registry/resolver and validation entry points.First use case: validating an incoming AT Protocol record before persistence. The exact API is small but young; inspect the facade or injectable schema resolver first, then wrap it in a Laravel form request or validation rule.
use SocialDept\AtpSchema\Schema; // illustrative import; confirm exact class
$schema = Schema::for('app.bsky.feed.post');
$schema->validate($record);
If your app only consumes lexicons indirectly, start by checking whether the package exposes a validation rule or facade you can bind into existing form requests.
Do a project-wide replacement before running tests:
// Before
use SocialDept\Schema\Schema;
use SocialDept\Schema\Lexicon;
// After
use SocialDept\AtpSchema\Schema;
use SocialDept\AtpSchema\Lexicon;
Search all PHP and non-PHP files, because class names often leak into config, cached payloads, and test fixtures:
grep -R "SocialDept\\\\Schema" app config database resources tests composer.json
Wrap schema validation in a form request so controllers stay clean:
public function rules(): array
{
return [
'record' => ['required', 'array'],
// Add a custom rule that delegates to SocialDept\AtpSchema
];
}
If the package exposes a schema resolver or registry, bind it in a service provider and inject it into actions/jobs rather than using static calls:
public function __construct(
private readonly \SocialDept\AtpSchema\SchemaResolver $schemas
) {}
This makes it easier to swap lexicons in tests and avoids hard-coding schema identifiers throughout the app.
Use the package to assert that fixtures match expected lexicons, and keep one happy-path plus one invalid-record test per record type. If the package provides fake or in-memory schema registration, use it to avoid network or filesystem dependencies.
Validate before dispatching jobs that persist AT Protocol records. If you serialize schema objects into queued payloads, re-check after the namespace change: serialized class names from old releases will not resolve.
use SocialDept\Schema\... statement, string class reference, config value, or serialized payload will fail after upgrade.composer dump-autoload -o and clear config/cache. Stale Laravel caches can hide the rename.vendor/composer/autoload_psr4.php if classes still are not found; confirm SocialDept\AtpSchema\ maps correctly.php artisan tinker and class_exists(\SocialDept\AtpSchema\...::class) to confirm autoloading before chasing validation failures.How can I help you explore Laravel packages today?