From 44a81a0c0544c134c5812af0d14bafa9d1545046 Mon Sep 17 00:00:00 2001 From: Fady Mondy Date: Tue, 31 Jan 2023 16:52:07 +0200 Subject: [PATCH] =?UTF-8?q?first=20commit=20=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Services/Agora.php | 47 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/Services/Agora.php b/src/Services/Agora.php index b2f6315..1891ffd 100644 --- a/src/Services/Agora.php +++ b/src/Services/Agora.php @@ -5,49 +5,94 @@ use Exception; use Queents\LaravelAgora\Services\Token\RtcTokenBuilder; +/** + * + */ class Agora { + /** + * @var string|int + */ protected string|int $id; + /** + * @var string|null + */ protected string|null $channel="agora"; - protected string|null $uId; + /** + * @var string|null + */ + protected string|null $uId = ""; + /** + * @var bool + */ protected bool $audio=false; + /** + * @var bool + */ protected bool $join = false; + /** + * @param string|int $id + * @return static + */ public static function make(string|int $id): static { return (new self())->id($id); } + /** + * @param string|int $id + * @return $this + */ public function id(string|int $id): static { $this->id = $id; return $this; } + /** + * @param bool|null $join + * @return $this + */ public function join(bool|null $join= true): static { $this->join = $join; return $this; } + /** + * @param bool|null $audio + * @return $this + */ public function audioOnly(bool|null $audio=true): static { $this->audio = $audio; return $this; } + /** + * @param string $channel + * @return $this + */ public function channel(string $channel): static { $this->channel = $channel; return $this; } + /** + * @param string $uId + * @return $this + */ public function uId(string $uId): static { $this->uId = $uId; return $this; } + /** + * @return string|void|null + */ public function token() { $appID = config('laravel-agora.agora.app_id');