PHPackages                             vihaya/events - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. vihaya/events

ActiveLibrary[API Development](/categories/api)

vihaya/events
=============

The official PHP SDK for the Vihaya Events platform.

v0.1.0(1mo ago)01↓100%MITPHPPHP ^8.1

Since Apr 8Pushed 4w agoCompare

[ Source](https://github.com/Vishnu252005/vihaya-sdk-php)[ Packagist](https://packagist.org/packages/vihaya/events)[ Docs](https://github.com/Vishnu252005/vihaya-sdk-php)[ RSS](/packages/vihaya-events/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Vihaya SDK for PHP — Official `vihaya/events` Composer Package
==============================================================

[](#vihaya-sdk-for-php--official-vihayaevents-composer-package)

[![Packagist Version](https://camo.githubusercontent.com/f1e0037e1959e71f8caec2c6257cd7a71d3ee3148e62eb345bf11f20d53f5b75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7669686179612f6576656e74732e737667)](https://packagist.org/packages/vihaya/events)[![Packagist Downloads](https://camo.githubusercontent.com/5bcf12336a0c26891e7868e383b6acbb62a8f1116f74eb86e36ef73e4f6c376c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7669686179612f6576656e74732e737667)](https://packagist.org/packages/vihaya/events)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/698ac99df5d7acec9704e9202f5d5f57e14d84938ad96e2151ca9c28564784c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d707572706c65)](https://www.php.net/)

> **`vihaya/events`** is the official PHP SDK for the **[Vihaya Events](https://vihaya.app)** platform. Build event listings, attendee registration flows, Razorpay payment verification, ticketing dashboards, Laravel apps, Symfony bundles, WordPress plugins, Drupal modules, Magento extensions, and any PHP 8.1+ backend — all with type-safe `readonly` models and forward-compatible parsing.

**Vihaya** is the modern events platform for India — a single stack for event organisers, ticketing, sponsor management, attendee registration, live check-in, and real-time analytics. This package is the fastest way to integrate the Vihaya Events API (`https://events.vihaya.app`) into any PHP codebase.

---

Table of contents
-----------------

[](#table-of-contents)

- [What is Vihaya?](#-what-is-vihaya)
- [Why the Vihaya PHP SDK?](#-why-the-vihaya-php-sdk)
- [The Vihaya SDK family](#-the-vihaya-sdk-family-7-languages)
- [Requirements](#-requirements)
- [Installation](#-installation)
- [Get your Vihaya API key](#-get-your-vihaya-api-key)
- [Quick start](#-quick-start)
- [Configuration](#-configuration)
- [Core concepts](#-core-concepts)
- [Usage guide](#-usage-guide)
- [Framework integrations](#-framework-integrations)
- [Mega events &amp; sub-events](#-mega-events--sub-events)
- [Razorpay payment flow](#-razorpay-payment-flow)
- [API reference](#-api-reference)
- [Models](#-models)
- [Error handling](#-error-handling)
- [Security best practices](#-security-best-practices)
- [FAQ](#-faq)
- [Keywords](#-keywords)
- [Development](#-development)
- [Contributing](#-contributing)
- [License](#-license)

---

🇮🇳 What is Vihaya?
------------------

[](#-what-is-vihaya)

**Vihaya** is an all-in-one events platform for India, built for organisers who run college fests, hackathons, conferences, workshops, meetups, bootcamps, summits, and corporate events. The Vihaya platform provides:

- 🎟️ **Event creation &amp; ticketing** with pricing tiers, promo codes, and a hosted checkout.
- 🏢 **Mega events** — bundle dozens of sub-events under one parent fest.
- 💳 **Razorpay payments** — end-to-end with server-side signature verification.
- 📋 **Custom registration fields** — T-shirt size, college, team members, dietary preferences, accommodation.
- 👥 **Attendee management** — real-time registrations, broadcasts, CSV exports.
- 📱 **Live check-in** with mobile QR scanning.
- 👩‍🏫 **Speakers, agenda, sponsors, FAQs.**
- 📊 **Analytics** — registrations, revenue, funnel tracking.

This **`vihaya/events`** Composer package lets PHP developers embed the Vihaya Events API into Laravel apps, Symfony bundles, WordPress plugins, Drupal modules, Magento 2 extensions, Slim micro-services, CodeIgniter projects, Yii apps, CakePHP apps, and standalone PHP scripts.

Production URL: **`https://events.vihaya.app`** · Marketing site: **`https://vihaya.app`** · Developer dashboard: **`https://events.vihaya.app/profile/developer`**

---

✨ Why the Vihaya PHP SDK?
-------------------------

[](#-why-the-vihaya-php-sdk)

- **🔐 Modern PHP** — `final readonly` model classes (PHP 8.2 features), strict types, named arguments.
- **🧪 Tested** — PHPUnit 10 suite with Guzzle `MockHandler`. 11 tests, 32 assertions, fully offline.
- **📦 Slim** — only `guzzlehttp/guzzle` and `ext-json` as dependencies.
- **🔄 Forward compatible** — every model preserves unknown fields on `$model->raw`, so the SDK survives API additions without a release.
- **🧩 PSR-friendly** — accepts a `Psr\Http\Client\ClientInterface` for custom HTTP middleware (logging, tracing, retries).
- **🎯 Strict typing** — every method signature is fully typed; PHPStan level 6 clean.
- **💳 Razorpay ready** — `$vihaya->events()->register()` → Razorpay → `$vihaya->payments()->verify()`.

---

🌍 The Vihaya SDK family (7 languages)
-------------------------------------

[](#-the-vihaya-sdk-family-7-languages)

LanguagePackageRepositoryInstall🐘 **PHP**[`vihaya/events`](https://packagist.org/packages/vihaya/events)[Vishnu252005/vihaya-sdk-php](https://github.com/Vishnu252005/vihaya-sdk-php)`composer require vihaya/events`🟨 **JavaScript / TypeScript**[`vihaya-sdk`](https://www.npmjs.com/package/vihaya-sdk)[Vishnu252005/vihaya-sdk](https://github.com/Vishnu252005/vihaya-sdk)`npm install vihaya-sdk`🐍 **Python**[`vihaya-events`](https://pypi.org/project/vihaya-events/)[Vishnu252005/vihaya-sdk-python](https://github.com/Vishnu252005/vihaya-sdk-python)`pip install vihaya-events`🦫 **Go**[`vihaya-sdk-go`](https://pkg.go.dev/github.com/Vishnu252005/vihaya-sdk-go)[Vishnu252005/vihaya-sdk-go](https://github.com/Vishnu252005/vihaya-sdk-go)`go get github.com/Vishnu252005/vihaya-sdk-go`☕ **Java**[`vihaya-sdk-java`](https://jitpack.io/#Vishnu252005/vihaya-sdk-java)[Vishnu252005/vihaya-sdk-java](https://github.com/Vishnu252005/vihaya-sdk-java)JitPack / Gradle / Maven💎 **Ruby**[`vihaya-events`](https://rubygems.org/gems/vihaya-events)[Vishnu252005/vihaya-sdk-ruby](https://github.com/Vishnu252005/vihaya-sdk-ruby)`gem install vihaya-events`📱 **Flutter / Dart**[`vihaya_sdk_flutter`](https://pub.dev/packages/vihaya_sdk_flutter)[Vishnu252005/vihaya-sdk-flutter](https://github.com/Vishnu252005/vihaya-sdk-flutter)`flutter pub add vihaya_sdk_flutter`All Vihaya SDKs target the same API base URL (`https://events.vihaya.app`), authenticate with the same `x-api-key` header, and expose the same methods.

---

📋 Requirements
--------------

[](#-requirements)

- **PHP 8.1, 8.2, 8.3, 8.4+**
- `ext-json`
- [`guzzlehttp/guzzle`](https://github.com/guzzle/guzzle) `^7.5` (pulled in automatically)

---

📦 Installation
--------------

[](#-installation)

```
composer require vihaya/events
```

Then load Composer's autoloader:

```
require __DIR__ . '/vendor/autoload.php';
```

Package name: **`vihaya/events`** on Packagist. PHP namespace: **`Vihaya\Events`**.

---

🔑 Get your Vihaya API key
-------------------------

[](#-get-your-vihaya-api-key)

1. Sign up or log in at **[events.vihaya.app](https://events.vihaya.app)**.
2. Open the **[Developer Dashboard](https://events.vihaya.app/profile/developer)**.
3. Click **Generate API Key** and copy the `vh_live_...` token.
4. Store it in `.env`, environment variables, or a secrets manager — never commit it to git.

```
# .env
VIHAYA_API_KEY=vh_live_xxxxxxxxxxxxxxxxxxxxxxxx
```

---

🚀 Quick start
-------------

[](#-quick-start)

```
