$payload */ public function __construct( public string $accountId, public array $payload, ) { $this->onQueue('posthog'); } public function handle(PostHogService $postHog): void { if (! PostHogService::shouldTrack()) { return; } $account = Account::with('plan')->find($this->accountId); if (! $account?->owner_id || ! $account->plan) { return; } $postHog->capture( (string) $account->owner_id, $this->event(), $this->properties($account), $account, ); } abstract protected function event(): string; /** * @return array */ abstract protected function properties(Account $account): array; }