spatie/laravel-bluesky-notification-channel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

spatie/laravel-bluesky-notification-channel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require spatie/laravel-bluesky-notification-channel

包简介

Send Bluesky notifications in Laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package makes it easy to send notifications to Bluesky using Laravel's notification system. Links, mentions and hashtags are automatically detected and rendered as rich text.

Here's how you can use it:

BlueskyPost::make()
    ->text('Hello from Laravel! Check out https://spatie.be')
    ->language('en');

In a notification:

<?php

use Illuminate\Notifications\Notification;
use Spatie\BlueskyNotificationChannel\BlueskyChannel;
use Spatie\BlueskyNotificationChannel\BlueskyPost;

class ServerDownNotification extends Notification
{
    public function via($notifiable): array
    {
        return [BlueskyChannel::class];
    }

    public function toBluesky($notifiable): BlueskyPost
    {
        return BlueskyPost::make()
            ->text("Our server {$this->server->name} is down!");
    }
}

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require spatie/laravel-bluesky-notification-channel

Add your Bluesky credentials to config/services.php:

'bluesky' => [
    'username' => env('BLUESKY_USERNAME'),
    'password' => env('BLUESKY_PASSWORD'),
],

Usage

Creating posts

You can create a post using the BlueskyPost class:

BlueskyPost::make()
    ->text('Hello, Bluesky!')
    ->language('en');

Rich text

The package automatically detects links, mentions (@handle.bsky.social) and hashtags (#topic) in your post text and converts them to rich text facets.

Embeds

Link embeds (cards with title, description and thumbnail) are automatically resolved from the first link in your post. You can also specify an embed URL explicitly:

BlueskyPost::make()
    ->text('Check this out!')
    ->embedUrl('https://spatie.be')

If you want to disable automatic embed resolution, call withoutAutomaticEmbeds():

BlueskyPost::make()
    ->text('https://spatie.be')
    ->withoutAutomaticEmbeds()

Using the service directly

You can also send posts without using notifications by resolving the BlueskyService from the container:

use Spatie\BlueskyNotificationChannel\BlueskyService;

app(BlueskyService::class)->createPost('Hello, Bluesky!');

Customization

You can swap out the default implementations by binding your own classes in a service provider:

use Spatie\BlueskyNotificationChannel\Facets\FacetsResolver;
use Spatie\BlueskyNotificationChannel\Embeds\EmbedResolver;
use Spatie\BlueskyNotificationChannel\IdentityRepository\IdentityRepository;

$this->app->singleton(FacetsResolver::class, MyCustomFacetsResolver::class);
$this->app->singleton(EmbedResolver::class, MyCustomEmbedResolver::class);
$this->app->singleton(IdentityRepository::class, MyCustomIdentityRepository::class);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

This package is a fork of innocenzi/bluesky-notification-channel by Enzo Innocenzi.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固