PHPackages                             genvoris/laravel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. genvoris/laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

genvoris/laravel
================

Official Laravel package for Genvoris Virtual Try-On

v1.0.0(2w ago)04MITPHPPHP ^8.1CI passing

Since May 22Pushed 2w agoCompare

[ Source](https://github.com/DevSajjadAli/laravel)[ Packagist](https://packagist.org/packages/genvoris/laravel)[ Docs](https://docs.genvoris.org)[ RSS](/packages/genvoris-laravel/feed)WikiDiscussions master Synced 1w ago

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

Genvoris Laravel
================

[](#genvoris-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4373aad6f7afd6e94d85c4891df24729ed2e505f57d8114a1aeeedc078d631c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656e766f7269732f6c61726176656c2e737667)](https://packagist.org/packages/genvoris/laravel)[![Tests](https://github.com/DevSajjadAli/laravel/actions/workflows/tests.yml/badge.svg)](https://github.com/DevSajjadAli/laravel/actions/workflows/tests.yml)[![PHP Version Require](https://camo.githubusercontent.com/0cf9a2f0aff9067010c1f3d1687c8af8f1fd19bbac4e759007390af939ad75ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f67656e766f7269732f6c61726176656c2e737667)](https://packagist.org/packages/genvoris/laravel)[![License](https://camo.githubusercontent.com/d2df5641d78ee3115f34b5437cebd6193960b3719ac6e94edd94036b133270c8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f44657653616a6a6164416c692f6c61726176656c2e737667)](LICENSE)

Official Laravel integration for the [Genvoris Virtual Try-On](https://genvoris.org) platform.

Add virtual try-on experiences to your Laravel application in minutes: upsert customers, mint session tokens, proxy widget requests server-side, and handle webhooks — all with zero client-side API key exposure.

---

Requirements
------------

[](#requirements)

DependencyVersionPHP^8.1Laravel^10.0 | ^11.0 | ^12.0---

Installation
------------

[](#installation)

```
composer require genvoris/laravel
```

Run the install command to publish config and add `.env` keys:

```
php artisan genvoris:install
```

Add your keys to `.env`:

```
GENVORIS_API_KEY=gvk_live_your_key_here
GENVORIS_WEBHOOK_SECRET=your_webhook_secret_here
```

Verify the connection:

```
php artisan genvoris:test-connection
```

---

Configuration
-------------

[](#configuration)

The published `config/genvoris.php` file exposes all options. The most important:

KeyEnv varDefaultDescription`api_key``GENVORIS_API_KEY``""`Your platform API key`api_base_url``GENVORIS_API_BASE_URL``https://genvoris.org/api/v1`Override for testing`timeout``GENVORIS_TIMEOUT``30`HTTP timeout (seconds)`retry.times`—`3`Max retries on 429 / 5xx`webhook.secret``GENVORIS_WEBHOOK_SECRET``""`HMAC secret for signatures`webhook.path``GENVORIS_WEBHOOK_PATH``webhooks/genvoris`Route prefix`webhook.auto_register`—`true`Auto-register webhook route`proxy.path``GENVORIS_PROXY_PATH``genvoris-proxy`Route prefix`proxy.auto_register`—`true`Auto-register proxy route`proxy.allowed_paths`—`[api/analyze, ...]`Forwarding allowlist`external_id_prefix`—`laravel_`Prefix on external customer IDs`widget_url`—`https://api.genvoris.org/widget.js`Widget script URL`cache.sessions`—`true`Cache minted session tokens`cache.ttl`—`840`Session cache TTL (seconds)---

Basic Usage
-----------

[](#basic-usage)

### Facade

[](#facade)

```
use Genvoris\Laravel\Facades\Genvoris;

// Upsert a customer (auto-prefixes the external ID → "laravel_42")
$customer = Genvoris::upsertCustomer('42', ['email' => 'alice@example.com']);

// Mint a session token for the widget
$session = Genvoris::mintSession($customer->id);

// List your plans
$plans = Genvoris::listPlans();

// Get a customer's usage
$usage = Genvoris::customerUsage($customer->id);
if ($usage->canTryOn()) { /* ... */ }
```

### Dependency injection

[](#dependency-injection)

```
use Genvoris\Laravel\Genvoris;

class TryOnController extends Controller
{
    public function __construct(private readonly Genvoris $genvoris) {}

    public function session(Request $request): JsonResponse
    {
        $session = $this->genvoris->mintSession($request->user()->genvorisCustomerId());
        return response()->json(['token' => $session->token]);
    }
}
```

---

HasGenvorisAccess Trait
-----------------------

[](#hasgenvorisaccess-trait)

Add the trait to your `User` model (or any Eloquent model) to get Genvoris helpers:

```
use Genvoris\Laravel\Concerns\HasGenvorisAccess;

class User extends Authenticatable
{
    use HasGenvorisAccess;
}
```

Available methods:

```
// Returns "laravel_{id}"
$user->genvorisExternalId();

// Upsert the user in the Genvoris platform (auto-syncs email if present)
$customer = $user->syncToGenvoris(['planId' => 'plan_basic']);

// Mint a session token (syncs first if needed)
$session = $user->genvorisSession(expiresIn: 900);

// Usage & entitlement
$usage = $user->genvorisUsage();
$user->canTryOn(); // bool — returns false gracefully on API errors

// Full portal Customer object
$customer = $user->genvorisPortalCustomer();
```

### Optional local cache table

[](#optional-local-cache-table)

Run the optional migration to cache customer IDs and avoid repeated API calls:

```
php artisan vendor:publish --tag=genvoris-migrations
php artisan migrate
```

---

Blade Directives
----------------

[](#blade-directives)

```
{{-- Load the widget script --}}
@genvorisScripts

{{-- Emit window.genvorisConfig (never exposes api_key) --}}
@genvorisConfig(['productId' => $product->id])

{{-- Combined shorthand --}}
@genvorisWidget(['productId' => $product->id])

{{-- Render a try-on button --}}
@genvorisTryOnButton(['productId' => $product->id, 'label' => 'Try On'])
```

Or use the Blade views directly:

```
@include('genvoris::widget', ['productId' => $product->id, 'token' => $session->token])
@include('genvoris::components.try-on-button', ['productId' => $product->id])
```

---

Webhooks
--------

[](#webhooks)

Register your endpoint in the Genvoris dashboard:

```
POST https://yourapp.com/webhooks/genvoris

```

The package auto-registers this route and verifies the HMAC-SHA256 signature on every request.

### Listening to events

[](#listening-to-events)

```
// In a service provider or EventServiceProvider
use Genvoris\Laravel\Webhooks\Events\CustomerCreated;
use Genvoris\Laravel\Webhooks\Events\GenvorisWebhookReceived;

Event::listen(CustomerCreated::class, function (CustomerCreated $event) {
    $payload = $event->payload;
    // create local user, send welcome email, etc.
});

// Catch all events
Event::listen(GenvorisWebhookReceived::class, function (GenvorisWebhookReceived $event) {
    Log::info("Genvoris webhook: {$event->type} ({$event->id})");
});
```

Or declare listeners in `config/genvoris.php`:

```
'webhook' => [
    'listeners' => [
        \Genvoris\Laravel\Webhooks\Events\CustomerCreated::class => [
            \App\Listeners\HandleGenvorisCustomerCreated::class,
        ],
    ],
],
```

### Supported event types

[](#supported-event-types)

Event typePHP class`end_customer.created``CustomerCreated``end_customer.updated``CustomerUpdated``end_customer.cancelled``CustomerCancelled``end_customer.quota_warning``CustomerQuotaWarning``end_customer.quota_exhausted``CustomerQuotaExhausted``end_customer.period_rolled``CustomerPeriodRolled``plan.created``PlanCreated``plan.updated``PlanUpdated``plan.disabled``PlanDisabled`All event classes are in the `Genvoris\Laravel\Webhooks\Events` namespace.

### Manual verification

[](#manual-verification)

```
use Genvoris\Laravel\Webhooks\WebhookVerifier;

$ok = (new WebhookVerifier())->verify(
    $request->getContent(),
    $request->header('X-Genvoris-Signature'),
    config('genvoris.webhook.secret'),
);
```

---

Proxy
-----

[](#proxy)

The package registers a `POST /genvoris-proxy/{path}` route that injects your API key server-side before forwarding to `api.genvoris.org`. Only paths in the `proxy.allowed_paths` allowlist are forwarded.

In your front-end widget configuration, set:

```
window.genvorisConfig = {
    apiProxyBase: '/genvoris-proxy/',
};
```

`@genvorisConfig` emits this automatically.

---

Artisan Commands
----------------

[](#artisan-commands)

CommandDescription`genvoris:install`Publish config, views, migration; add `.env` keys`genvoris:test-connection`Verify API key by listing plans`genvoris:list-plans`Display plan table`genvoris:list-customers`Display customer table (`--limit`, `--page`)`genvoris:webhook-test`Send a signed test webhook to your endpoint---

Testing
-------

[](#testing)

Install dev dependencies and run the suite:

```
composer install
composer test
```

Run code style checks:

```
composer lint:check   # check only
composer lint         # auto-fix
```

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for a list of changes.

---

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome at the project's GitHub repository.
Before submitting a PR, please run `composer test` and `composer lint:check`.

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

---

Support
-------

[](#support)

- Docs:
- Email:

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance96

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

19d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7c3a49fb1b1c9b14de65fe7553140c0b38e76fd9c0576b949bda6a3332c1338?d=identicon)[DevSajjadAli](/maintainers/DevSajjadAli)

---

Top Contributors

[![DevSajjadAli](https://avatars.githubusercontent.com/u/182598590?v=4)](https://github.com/DevSajjadAli "DevSajjadAli (8 commits)")

---

Tags

laravelaiecommercefashionVirtual Try-Ongenvorisvton

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/genvoris-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/genvoris-laravel/health.svg)](https://phpackages.com/packages/genvoris-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[spatie/laravel-export

Create a static site bundle from a Laravel app

670139.5k6](/packages/spatie-laravel-export)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
