Skip to content

Commit

Permalink
first commit 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Jan 31, 2023
1 parent 9131bae commit 44a81a0
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion src/Services/Agora.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 44a81a0

Please sign in to comment.