Laravel AT Protocol Client (alpha & unstable)
at main 1.0 kB view raw
1<?php 2 3namespace SocialDept\AtpClient\Client; 4 5use SocialDept\AtpClient\AtpClient; 6use SocialDept\AtpClient\Client\Requests\Chat; 7use SocialDept\AtpClient\Concerns\HasDomainExtensions; 8 9class ChatClient 10{ 11 use HasDomainExtensions; 12 /** 13 * The parent AtpClient instance 14 */ 15 protected AtpClient $atp; 16 17 /** 18 * Conversation operations (chat.bsky.convo.*) 19 */ 20 public Chat\ConvoRequestClient $convo; 21 22 /** 23 * Actor operations (chat.bsky.actor.*) 24 */ 25 public Chat\ActorRequestClient $actor; 26 27 public function __construct(AtpClient $parent) 28 { 29 $this->atp = $parent; 30 $this->convo = new Chat\ConvoRequestClient($this); 31 $this->actor = new Chat\ActorRequestClient($this); 32 } 33 34 protected function getDomainName(): string 35 { 36 return 'chat'; 37 } 38 39 protected function getRootClientClass(): string 40 { 41 return AtpClient::class; 42 } 43 44 public function root(): AtpClient 45 { 46 return $this->atp; 47 } 48}