承接 danielpetrica/laravel-activitypub 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

danielpetrica/laravel-activitypub

Composer 安装命令:

composer require danielpetrica/laravel-activitypub

包简介

ActivityPub server implementation for Laravel applications. WebFinger, actor profiles, inbox/outbox, and federation.

README 文档

README

A self-hosted ActivityPub server implementation for Laravel 13, enabling federation with the Fediverse (Mastodon, Pleroma, Misskey, Pixelfed, PeerTube, etc.).

Features

  • WebFinger — Actor discovery via /.well-known/webfinger
  • Actor profiles — ActivityStreams JSON-LD representations
  • Inbox/OutboxOrderedCollection with pagination support
  • HTTP Signatures — RSA-SHA256 signing and verification with Digest support
  • Federation — Outbound delivery of Create, Update, Delete, Follow, Accept, Like, Announce, Undo, and replies
  • Follower management — Track followers from remote servers
  • Shared inboxPOST /inbox for instance-level activity delivery
  • NodeInfo/.well-known/nodeinfo and /nodeinfo/2.0
  • host-meta/.well-known/host-meta with WebFinger XRD template
  • Blade-based Fediverse web UI — Dashboard, timeline, inbox, discover, profile editing
  • Artisan commandsactivitypub:create-actor, activitypub:prune-activities
  • Queue jobs — Async delivery with retries, remote actor fetching with deduplication

Installation

composer require danielpetrica/laravel-activitypub

Publish the configuration and migrations:

php artisan vendor:publish --tag=activitypub-config
php artisan vendor:publish --tag=activitypub-migrations
php artisan migrate

Configuration

ACTIVITYPUB_DOMAIN=https://your-domain.com
ACTIVITYPUB_FEDERATION_ENABLED=true   # enable outbound federation
ACTIVITYPUB_FEDIVERSE_ENABLED=true    # enable Blade-based web UI

Creating an Actor

php artisan activitypub:create-actor --username=yourname --name="Your Name"

Federating Content

Have your Eloquent model implement FederatableContentContract and use the FederatesContent trait:

use DanielPetrica\LaravelActivityPub\Contracts\FederatableContentContract;
use DanielPetrica\LaravelActivityPub\Traits\FederatesContent;

class Post extends Model implements FederatableContentContract
{
    use FederatesContent;

    public function shouldFederate(): bool { return $this->status === 'published'; }
    public function activityPubActor(): ActorContract { /* return your actor */ }
    public function getActivityPubId(): string { return url("/posts/{$this->id}"); }
    // ... implement remaining contract methods
}

Testing

vendor/bin/pest --filter=InboxProcessingTest
vendor/bin/pest --filter=ConsoleCommandsTest

Postponed Features (TODO)

These items are planned for future releases:

  • Move / AlsoKnownAs — Account migration support (see ActivityPub spec §5.4)
  • Block activity — Blocking remote actors, filtering blocked content from timeline
  • Tailwind CSS build step — The Fediverse web UI currently loads Tailwind via CDN. Replace with a compiled CSS build step for production.
  • Full OrderedCollectionPage pagination — Currently returns OrderedCollection with first/last pointers. Proper page-by-page OrderedCollectionPage responses should be added.
  • JSON-LD compaction — Handle compacted JSON-LD payloads from Pleroma/Akkoma.
  • outbox_url shared inbox — Add sharedInbox to actor profiles for servers that support it.
  • Admin dashboard — Filament-based admin panel for managing actors, viewing federation stats.

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固