Laravel AT Protocol Client (alpha & unstable)
at main 2.1 kB view raw
1<?php 2 3namespace SocialDept\AtpClient\Client; 4 5use SocialDept\AtpClient\AtpClient; 6use SocialDept\AtpClient\Client\Records\FollowRecordClient; 7use SocialDept\AtpClient\Client\Records\LikeRecordClient; 8use SocialDept\AtpClient\Client\Records\PostRecordClient; 9use SocialDept\AtpClient\Client\Records\ProfileRecordClient; 10use SocialDept\AtpClient\Client\Requests\Bsky; 11use SocialDept\AtpClient\Concerns\HasDomainExtensions; 12 13class BskyClient 14{ 15 use HasDomainExtensions; 16 17 /** 18 * The parent AtpClient instance 19 */ 20 protected AtpClient $atp; 21 22 /** 23 * Feed operations (app.bsky.feed.*) 24 */ 25 public Bsky\FeedRequestClient $feed; 26 27 /** 28 * Actor operations (app.bsky.actor.*) 29 */ 30 public Bsky\ActorRequestClient $actor; 31 32 /** 33 * Graph operations (app.bsky.graph.*) 34 */ 35 public Bsky\GraphRequestClient $graph; 36 37 /** 38 * Labeler operations (app.bsky.labeler.*) 39 */ 40 public Bsky\LabelerRequestClient $labeler; 41 42 /** 43 * Post record client 44 */ 45 public PostRecordClient $post; 46 47 /** 48 * Profile record client 49 */ 50 public ProfileRecordClient $profile; 51 52 /** 53 * Like record client 54 */ 55 public LikeRecordClient $like; 56 57 /** 58 * Follow record client 59 */ 60 public FollowRecordClient $follow; 61 62 public function __construct(AtpClient $parent) 63 { 64 $this->atp = $parent; 65 $this->feed = new Bsky\FeedRequestClient($this); 66 $this->actor = new Bsky\ActorRequestClient($this); 67 $this->graph = new Bsky\GraphRequestClient($this); 68 $this->labeler = new Bsky\LabelerRequestClient($this); 69 $this->post = new PostRecordClient($this); 70 $this->profile = new ProfileRecordClient($this); 71 $this->like = new LikeRecordClient($this); 72 $this->follow = new FollowRecordClient($this); 73 } 74 75 protected function getDomainName(): string 76 { 77 return 'bsky'; 78 } 79 80 protected function getRootClientClass(): string 81 { 82 return AtpClient::class; 83 } 84 85 public function root(): AtpClient 86 { 87 return $this->atp; 88 } 89}