findById($appId); } public static function findByKey(string $appKey): ?self { return app(AppProvider::class)->findByKey($appKey); } public static function findBySecret(string $appSecret): ?self { return app(AppProvider::class)->findBySecret($appSecret); } public function __construct($appId, string $appKey, string $appSecret) { if ($appKey === '') { throw InvalidApp::valueIsRequired('appKey', $appId); } if ($appSecret === '') { throw InvalidApp::valueIsRequired('appSecret', $appId); } $this->id = $appId; $this->key = $appKey; $this->secret = $appSecret; } public function setName(string $appName) { $this->name = $appName; return $this; } public function setServer(string $server) { $this->server = $server; return $this; } public function enableClientMessages(bool $enabled = true) { $this->clientMessagesEnabled = $enabled; return $this; } public function enableStatistics(bool $enabled = true) { $this->statisticsEnabled = $enabled; return $this; } }