Laravel AT Protocol Client (alpha & unstable)
1<?php
2
3namespace SocialDept\AtpClient\Events;
4
5use Illuminate\Foundation\Events\Dispatchable;
6use Illuminate\Queue\SerializesModels;
7use SocialDept\AtpClient\Data\AccessToken;
8use SocialDept\AtpClient\Enums\AuthType;
9
10class SessionAuthenticated
11{
12 use Dispatchable, SerializesModels;
13
14 public function __construct(
15 public readonly AccessToken $token,
16 ) {}
17
18 public function isOAuth(): bool
19 {
20 return $this->token->authType === AuthType::OAuth;
21 }
22
23 public function isLegacy(): bool
24 {
25 return $this->token->authType === AuthType::Legacy;
26 }
27}