PHPackages                             togul/laravel-sdk - 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. togul/laravel-sdk

ActiveLibrary[API Development](/categories/api)

togul/laravel-sdk
=================

Laravel integration for Togul Feature Flag Service

v3.0.3(2mo ago)07MITPHP &gt;=8.1

Since Mar 14Compare

[ Source](https://github.com/togulapp/togul-laravel)[ Packagist](https://packagist.org/packages/togul/laravel-sdk)[ RSS](/packages/togul-laravel-sdk/feed)WikiDiscussions Synced 3w ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

Togul Laravel SDK
=================

[](#togul-laravel-sdk)

Laravel integration layer for the Togul PHP SDK.

Install
-------

[](#install)

```
composer require togul/laravel-sdk
php artisan vendor:publish --tag=togul-config
```

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

[](#configuration)

Add to `.env`:

```
TOGUL_API_KEY=your-environment-api-key
TOGUL_ENVIRONMENT=production
TOGUL_TIMEOUT=5
TOGUL_CACHE_TTL=30
TOGUL_RETRY_COUNT=2
```

Usage
-----

[](#usage)

### Via facade

[](#via-facade)

```
use Togul\Laravel\Facades\Togul;

$result = Togul::evaluate('new-dashboard', [
    'user_id' => (string) auth()->id(),
]);

var_dump($result->enabled);   // true
var_dump($result->valueType); // "string"
var_dump($result->value);     // "dark_mode"
var_dump($result->reason);    // "rule_match"
```

### Via dependency injection

[](#via-dependency-injection)

```
use Togul\TogulClient;

public function __invoke(TogulClient $togul)
{
    $result = $togul->evaluate('new-dashboard', [
        'user_id' => (string) auth()->id(),
    ]);
}
```

### Via middleware

[](#via-middleware)

```
Route::get('/dashboard', DashboardController::class)
    ->middleware('togul:new-dashboard');
```

EvaluateResult
--------------

[](#evaluateresult)

`evaluate()` returns an `EvaluateResult` object:

```
$result->flagKey;    // string  — flag identifier
$result->enabled;    // bool    — whether the flag is on
$result->valueType;  // string  — "boolean" | "string" | "number" | "json"
$result->value;      // mixed   — the resolved value
$result->reason;     // string  — e.g. "rule_match", "default"
```

### Cache invalidation

[](#cache-invalidation)

```
Togul::invalidateFlag('new-dashboard'); // single flag
Togul::invalidateCache();               // all flags
```

Notes
-----

[](#notes)

- `TOGUL_API_KEY` must be an environment API key, not a user JWT.
- This package wraps `togul/php-sdk`; evaluation behavior follows the PHP SDK.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance87

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Every ~11 days

Total

7

Last Release

62d ago

Major Versions

2.4.0 → 3.0.02026-05-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10656351?v=4)[togul](/maintainers/togul)[@Togul](https://github.com/Togul)

### Embed Badge

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

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

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

813336.8k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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