Laravel AT Protocol Client (alpha & unstable)
at main 60 lines 1.4 kB view raw
1<?php 2 3namespace SocialDept\AtpClient\Client; 4 5use SocialDept\AtpClient\AtpClient; 6use SocialDept\AtpClient\Client\Requests\Atproto; 7use SocialDept\AtpClient\Concerns\HasDomainExtensions; 8 9class AtprotoClient 10{ 11 use HasDomainExtensions; 12 /** 13 * The parent AtpClient instance 14 */ 15 protected AtpClient $atp; 16 17 /** 18 * Repository operations (com.atproto.repo.*) 19 */ 20 public Atproto\RepoRequestClient $repo; 21 22 /** 23 * Server operations (com.atproto.server.*) 24 */ 25 public Atproto\ServerRequestClient $server; 26 27 /** 28 * Identity operations (com.atproto.identity.*) 29 */ 30 public Atproto\IdentityRequestClient $identity; 31 32 /** 33 * Sync operations (com.atproto.sync.*) 34 */ 35 public Atproto\SyncRequestClient $sync; 36 37 public function __construct(AtpClient $parent) 38 { 39 $this->atp = $parent; 40 $this->repo = new Atproto\RepoRequestClient($this); 41 $this->server = new Atproto\ServerRequestClient($this); 42 $this->identity = new Atproto\IdentityRequestClient($this); 43 $this->sync = new Atproto\SyncRequestClient($this); 44 } 45 46 protected function getDomainName(): string 47 { 48 return 'atproto'; 49 } 50 51 protected function getRootClientClass(): string 52 { 53 return AtpClient::class; 54 } 55 56 public function root(): AtpClient 57 { 58 return $this->atp; 59 } 60}