PHPackages                             clearlyip/laravel-flagsmith - 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. clearlyip/laravel-flagsmith

ActiveLibrary[API Development](/categories/api)

clearlyip/laravel-flagsmith
===========================

A Flagsmith client for Laravel

3.2.0(1y ago)7175.5k↑55.9%4[3 PRs](https://github.com/clearlyip/laravel-flagsmith/pulls)BSD-3-ClausePHPPHP ^8.2CI passing

Since Oct 21Pushed 5mo ago6 watchersCompare

[ Source](https://github.com/clearlyip/laravel-flagsmith)[ Packagist](https://packagist.org/packages/clearlyip/laravel-flagsmith)[ RSS](/packages/clearlyip-laravel-flagsmith/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (8)Versions (14)Used By (0)

[![](https://github.com/Flagsmith/flagsmith/raw/main/static-files/hero.png)](https://github.com/Flagsmith/flagsmith/raw/main/static-files/hero.png)

Laravel-flagsmith was created by, and is maintained by **[Andrew Nagy](https://github.com/tm1000)**, the package is designed to allow Laravel to work with [Flagsmith](https://flagsmith.com/)

[![Total Downloads](https://camo.githubusercontent.com/0b35699651f9ad591129510b38d732c55daad0313e8b58646e2a03e4e2bab2a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c6561726c7969702f6c61726176656c2d666c6167736d697468)](https://packagist.org/packages/clearlyip/laravel-flagsmith)[![Latest Stable Version](https://camo.githubusercontent.com/52a0a1cce1dbc21b4a7e8c9932196283005c840e1742368dbcf4299ae76c8829/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c6561726c7969702f6c61726176656c2d666c6167736d697468)](https://packagist.org/packages/clearlyip/laravel-flagsmith)[![License](https://camo.githubusercontent.com/70dfccbafb82a55b5db6b53a2f3be0bc061ca98c614e02ef641fcef80797ac0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636c6561726c7969702f6c61726176656c2d666c6167736d697468)](https://packagist.org/packages/clearlyip/laravel-flagsmith)

Features
--------

[](#features)

- Provides a trait to be able to get flags based on Laravel Users ([Flagsmith Identities](https://docs.flagsmith.com/basic-features/managing-identities))
- Utilizes [Laravel's Queue](https://laravel.com/docs/8.x/queues) system to update flags in the background
- Utilizes [Laravel's Cache](https://laravel.com/docs/8.x/cache) system to store flags in a cache for quick access
- Utilizes [Laravel's Task Scheduling](https://laravel.com/docs/8.x/scheduling) system to update flags on a schedule
- Adds a route to utilize [Flagsmith's webhooks](https://docs.flagsmith.com/advanced-use/system-administration) to update the cache when flags change

Installation &amp; Usage
------------------------

[](#installation--usage)

> **Requires [PHP 8.2+](https://php.net/releases/)**

Require Laravel-flagsmith using [Composer](https://getcomposer.org):

```
composer require clearlyip/laravel-flagsmith
```

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

LaravelLaravel Flagsmith8.x1.x9.x2.x10.x3.xUsage
-----

[](#usage)

### Configuration Files

[](#configuration-files)

- Publish the Laravel Flagsmith configuration file using the `vendor:publish` Artisan command. The `flagsmith` configuration file will be placed in your `config` directory (Use `--force` to overwrite your existing `clearly` config file):
    - `php artisan vendor:publish --tag="flagsmith" [--force]`

All options are fully documented in the configuration file

### User

[](#user)

It's advised to add the interface `Clearlyip\LaravelFlagsmith\Contracts\UserFlags` to your user model. This will give you the ability to access flags directly from your user object.

You can add the following trait `Clearlyip\LaravelFlagsmith\Concerns\HasFlagss` to your user model to fulfill the requirements of `UserFlags`

During initial login user flags are synced through a queue which keeps them as up to date as possible

#### Get All Flags for a User

[](#get-all-flags-for-a-user)

```
$user = Auth::user();
$flags = $user->getFlags();
```

### Check if flag is enabled for a user

[](#check-if-flag-is-enabled-for-a-user)

An optional second parameter can be added as the default if the flag does not exist

```
$user = Auth::user();
$flags = $user->isFlagEnabled('foo');
```

#### Get a Flag value for a User

[](#get-a-flag-value-for-a-user)

An optional second parameter can be added as the default if the flag does not exist

```
$user = Auth::user();
$vakue = $user->getFlagValue('foo');
```

### Accessing

[](#accessing)

The Flagsmith Class can be accessed through Laravel's Container. The returned class is simply [flagsmith-php-client](https://github.com/Flagsmith/flagsmith-php-client)

```
$flagsmith = App::make(Flagsmith::class);
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance60

Regular maintenance activity

Popularity42

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 76.1% 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

Every ~124 days

Recently: every ~173 days

Total

11

Last Release

424d ago

Major Versions

1.2.1 → 2.0.02022-11-11

2.1.1 → 3.0.02024-03-18

PHP version history (3 changes)1.0.0PHP &gt;=7.4

1.2.0PHP ^7.4 || ^8.0

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ec0eab735e90845e372e877f867df9d50957c7aeb79437b13863aa1d299e188?d=identicon)[tm1000](/maintainers/tm1000)

---

Top Contributors

[![tm1000](https://avatars.githubusercontent.com/u/564256?v=4)](https://github.com/tm1000 "tm1000 (35 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![Rikj000](https://avatars.githubusercontent.com/u/24852597?v=4)](https://github.com/Rikj000 "Rikj000 (1 commits)")[![tomschlick](https://avatars.githubusercontent.com/u/70184?v=4)](https://github.com/tomschlick "tomschlick (1 commits)")

---

Tags

composerlaravelphp

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[echolabsdev/prism

A powerful Laravel package for integrating Large Language Models (LLMs) into your applications.

2.3k388.3k10](/packages/echolabsdev-prism)[sburina/laravel-whmcs-up

WHMCS API client and user provider for Laravel

271.3k](/packages/sburina-laravel-whmcs-up)

PHPackages © 2026

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