Build Reactive Signals for Bluesky's AT Protocol Firehose in Laravel
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Apply Laravel Pint formatting and code style fixes

+7 -5
+3 -3
config/signal.php
··· 9 9 | The mode determines which AT Protocol stream to consume: 10 10 | - 'jetstream': JSON events with server-side collection filtering 11 11 | (only standard app.bsky.* collections get create/update) 12 - | - 'firehose': Raw CBOR events with client-side filtering 13 - | (all collections including custom ones get all operations) 12 + | - 'firehose': Raw CBOR events with client-side filtering 13 + | (all collections including custom ones get all operations) 14 14 | 15 15 */ 16 16 'mode' => env('SIGNAL_MODE', 'jetstream'), ··· 80 80 | 81 81 */ 82 82 'signals' => [ 83 - // App\Signals\NewPostSignal::class, 83 + // App\Signals\PostCreateSignal::class, 84 84 ], 85 85 86 86 /*
+2 -1
src/Services/SignalRegistry.php
··· 4 4 5 5 use Illuminate\Support\Collection; 6 6 use Illuminate\Support\Facades\File; 7 + use InvalidArgumentException; 7 8 use SocialDept\Signal\Signals\Signal; 8 9 9 10 class SignalRegistry ··· 21 22 public function register(string $signalClass): void 22 23 { 23 24 if (! is_subclass_of($signalClass, Signal::class)) { 24 - throw new \InvalidArgumentException( 25 + throw new InvalidArgumentException( 25 26 'Signal class must extend '.Signal::class 26 27 ); 27 28 }
+2 -1
src/Storage/DatabaseCursorStore.php
··· 2 2 3 3 namespace SocialDept\Signal\Storage; 4 4 5 + use Illuminate\Database\Query\Builder; 5 6 use Illuminate\Support\Facades\DB; 6 7 use SocialDept\Signal\Contracts\CursorStore; 7 8 ··· 44 45 ->delete(); 45 46 } 46 47 47 - protected function query() 48 + protected function query(): Builder 48 49 { 49 50 return DB::connection($this->connection) 50 51 ->table($this->table);