PHP code example of innocenzi / bluesky-notification-channel

1. Go to this page and download the library: Download innocenzi/bluesky-notification-channel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

innocenzi / bluesky-notification-channel example snippets


return [
    // ...
    'bluesky' => [
      'username' => env('BLUESKY_USERNAME'),
      'password' => env('BLUESKY_PASSWORD'),
    ]
];

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

    public function toBluesky(object $notifiable): BlueskyPost
    {
        return BlueskyPost::make()
            ->text('Test from Laravel');
    }
}

// Without a notifiable
(new AnonymousNotifiable())->notify(new CreateBlueskyPost);

// With a notifiable
$post->notify(new CreateBlueskyPost);