PHPackages                             shipsaas/dev-flag - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. shipsaas/dev-flag

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

shipsaas/dev-flag
=================

Dev Flag implementation for Laravel Applications

1.1.0(2y ago)09MITPHPPHP ^8.1|^8.2

Since Dec 17Pushed 2y agoCompare

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

READMEChangelog (2)Dependencies (17)Versions (3)Used By (0)

Laravel DevFlag / FeatureFlag - ShipSaaS
========================================

[](#laravel-devflag--featureflag---shipsaas)

[![Build & Test (Laravel vers)](https://github.com/shipsaas/dev-flag/actions/workflows/build_laravel.yml/badge.svg)](https://github.com/shipsaas/dev-flag/actions/workflows/build_laravel.yml)[![Build & Test (PHP vers)](https://github.com/shipsaas/dev-flag/actions/workflows/build_php.yml/badge.svg)](https://github.com/shipsaas/dev-flag/actions/workflows/build_php.yml)[![Try Install Package (Laravel vers)](https://github.com/shipsaas/dev-flag/actions/workflows/try-installation.yml/badge.svg)](https://github.com/shipsaas/dev-flag/actions/workflows/try-installation.yml)[![codecov](https://camo.githubusercontent.com/104a46d7a0e2bf59c3122189b73a2555d89ce840f0031ca6f2e346f0b336a173/68747470733a2f2f636f6465636f762e696f2f67682f73686970736161732f6465762d666c61672f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d34574149393550445554)](https://codecov.io/gh/shipsaas/dev-flag)

DevFlag (aka Feature Flag) enabling your Application Development to follow the CI/CD best practices.

Support
-------

[](#support)

- PHP 8.0+
- Laravel 9.x &amp; 10.x

Install
-------

[](#install)

```
composer require shipsaas/dev-flag
```

Then hit this to get the `devflag.php` to your codebase:

```
php artisan vendor:publish --tag=devflag
```

Deep dive
---------

[](#deep-dive)

### Problems

[](#problems)

IRL projects, it is inevitable for PRs that contains a lot of changes (thousands of lines, 50+ files).

For those PRs, even you have 10 people to review, they still won't cover everything 100%. Simply because it is too much.

Everybody loves small PRs and that is the undeniable fact. But how can we achieve it?

Welcome to DevFlag!

### Solutions

[](#solutions)

DevFlag will help you to achieve that. Not only the tool, but also require a bit of your critical thinking.

Before starting development, you need to ensure:

- The scope, the changes that you will do (aka Technical Breakdown)
    - This is the most important phase, you need to finalize the:
        - Schema changes: avoid updating too much
        - Code
- Create a DevFlag
- Start the development

Further reading for the PROs:

- [Practical on DevFlag](https://antman-does-software.com/dev-flags-supercharge-your-continuous-deployment-by-dropping-database-feature-toggles)

Usage
-----

[](#usage)

### Add a new Flag

[](#add-a-new-flag)

Open the `app/devflag.php`, prepare your application's environments. Add your flag into all envs:

```
return [
    'local' => [
        'useNewFeature' => true,
    ],
    'testing' => [
        'useNewFeature' => true,
    ],
    'staging' => [
        'useNewFeature' => false,
    ],
    'production' => [
        'useNewFeature' => false,
    ],
];
```

### Check

[](#check)

Func-way:

```
function transfer(): ?Transaction
{
    $useNewFeature = useDevFlag('useNewFeature');

    if (!$useNewFeature) {
        return null;
    }

    // doing awesome things

    return $transaction;
}
```

OOP/DI-way:

```
use ShipSaaS\DevFlag\Contracts\DevFlagInterface;

public function __construct(private DevFlagInterface $devFlag) {}

public function transfer(): mixed
{
    if (!$this->devFlag->can('useNewFeature')) {
        return null;
    }

    // handle new things
}
```

IRL Use cases
-------------

[](#irl-use-cases)

Check out WIKI:

Contribution rules
------------------

[](#contribution-rules)

- Follow PSR-1 &amp; PSR-12 coding conventions
- TDD is a must

Feel free to open a PR 😉

Maintainer
----------

[](#maintainer)

- @sethsandaru

License
-------

[](#license)

MIT License

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Every ~169 days

Total

2

Last Release

1079d ago

PHP version history (2 changes)1.0.0PHP ^8.0|^8.1

1.1.0PHP ^8.1|^8.2

### Community

Maintainers

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

---

Top Contributors

[![sethsandaru](https://avatars.githubusercontent.com/u/23478115?v=4)](https://github.com/sethsandaru "sethsandaru (6 commits)")

---

Tags

best-practicesci-cdcicdlaravelphplaravel devflaglaravel devflag ci-cd best practices with ShipSaaSlaravel dev flagsmall PR practices with laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shipsaas-dev-flag/health.svg)

```
[![Health](https://phpackages.com/badges/shipsaas-dev-flag/health.svg)](https://phpackages.com/packages/shipsaas-dev-flag)
```

###  Alternatives

[slimkit/plus

The Plus(ThinkSNS+) is a powerful, easy-to-develop social system built with Laravel.

2.2k2.4k](/packages/slimkit-plus)[laravel-fans/docker

Full Laravel production environment for Docker

4311.3k](/packages/laravel-fans-docker)[downtoworld/laravel-devops

Laravel Cloudflare-Tunnels Ready Production Docker-Compose

161.1k](/packages/downtoworld-laravel-devops)

PHPackages © 2026

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