Download the PHP package socialdept/atp-orm without Composer

On this page you can find all versions of the php package socialdept/atp-orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package atp-orm

Eloquent-like ORM for AT Protocol remote records in Laravel.



What is ORM?

ORM is a Laravel package that brings an Eloquent-like interface to AT Protocol remote records. Query Bluesky posts, likes, follows, and any other AT Protocol collection as if they were local database models — with built-in caching, pagination, dirty tracking, and write support.

Think of it as Eloquent, but for the AT Protocol.

Why use ORM?

Quick Example

Installation

ORM will auto-register with Laravel. Optionally publish the config:

Defining Remote Records

Create a model class that extends RemoteRecord:

This generates:

Property Description
$collection The AT Protocol collection NSID
$recordClass The atp-schema DTO class for type-safe hydration
$cacheTtl Cache duration in seconds (0 = use config default)

Querying Records

Listing Records

Finding a Single Record

Pagination

ORM uses cursor-based pagination, matching the AT Protocol's native pattern:

You can also paginate manually with after():

Accessing Attributes

Records support property access, array access, and method access:

Caching

ORM caches query results automatically with configurable TTLs.

Cache TTL Resolution

TTLs are resolved in order of specificity:

  1. Query-level - ->remember($ttl) on the builder
  2. Model-level - $cacheTtl property on the RemoteRecord
  3. Collection-level - Per-collection overrides in config
  4. Global - cache.default_ttl in config

Manual Invalidation

Automatic Invalidation

When paired with atp-signals, ORM can automatically invalidate cache entries when records change on the network:

Cache Providers

ORM ships with three cache providers:

Provider Use Case
LaravelCacheProvider Production (default) - uses Laravel's cache system
FileCacheProvider Standalone file-based caching
ArrayCacheProvider Testing - in-memory, non-persistent

Write Operations

Write operations require an authenticated context via as():

Creating Records

Updating Records

Deleting Records

Dirty Tracking

ORM tracks attribute changes like Eloquent:

Bulk Loading with CAR Export

When you need to load an entire collection efficiently, use fromRepo() to fetch via CAR export instead of paginating through listRecords:

This uses com.atproto.sync.getRepo to fetch the repository as a CAR file and extract records locally — significantly faster for large collections.

Backlink Queries

ORM integrates with Microcosm's Constellation to discover all records that link to a given record across the entire AT Protocol network.

Basic Usage

Convenience Methods

Common Bluesky interaction types have built-in shortcuts:

Custom Sources

Query any collection and field path using source():

The source format is collection:path where the path is the dot-notation location of the linking field within the record.

Standalone Queries

You don't need a RemoteRecord instance to query backlinks:

Link Summary

Get a summary of all link types pointing at a target at once:

Pagination

Backlink queries support cursor-based pagination:

Hydration

Hydrate backlink references into full RemoteRecord instances via Slingshot:

BacklinkCollection Helpers

Slingshot Record Source

By default, ORM fetches records directly from the user's PDS. You can optionally route through Slingshot for faster cached reads:

Or set it globally in config:

Slingshot returns the same record data as the PDS, but from a globally distributed cache. Records may be slightly stale compared to direct PDS reads.

Events

ORM fires Laravel events for record lifecycle changes:

Event Fired When
RecordCreated A new record is created
RecordUpdated An existing record is updated
RecordDeleted A record is deleted
RecordFetched A record is fetched from remote

Events can be disabled in config:

AT-URI Helper

ORM includes an AtUri helper for parsing and building AT Protocol URIs:

RemoteCollection

Query results are returned as RemoteCollection instances with a familiar collection API:

Configuration

Customize behavior in config/atp-orm.php:

Error Handling

ORM throws descriptive exceptions:

Testing

Run the test suite:

Use the ArrayCacheProvider in tests for fast, isolated caching:

Requirements

Optional

Resources

Support & Contributing

Found a bug or have a feature request? Open an issue.

Want to contribute? We'd love your help! Check out the contribution guidelines.

Credits

License

ORM is open-source software licensed under the MIT license.


Built for the Atmosphere • By Social Dept.


All versions of atp-orm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^11.0|^12.0|^13.0
socialdept/atp-cbor Version ^0.2
socialdept/atp-client Version ^0.1 || ^0.2 || ^0.3
socialdept/atp-schema Version ^0.4
socialdept/atp-support Version ^0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package socialdept/atp-orm contains the following files

Loading the files please wait ...