PHPackages                             jasny/invite-code - 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. jasny/invite-code

AbandonedArchivedLibrary

jasny/invite-code
=================

Library for using invitation codes

v0.1.0(5y ago)174751[2 issues](https://github.com/jasny/invite-code/issues)MITPHPPHP &gt;=5.4.0

Since Aug 26Pushed 5y ago2 watchersCompare

[ Source](https://github.com/jasny/invite-code)[ Packagist](https://packagist.org/packages/jasny/invite-code)[ Docs](http://jasny.github.com/invite-code)[ RSS](/packages/jasny-invite-code/feed)WikiDiscussions master Synced 1mo ago

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

Jasny Invite code
=================

[](#jasny-invite-code)

[![Build Status](https://camo.githubusercontent.com/6101a29ab8307dce4bc06e901914c7c84d1463ccea8cc57923c8a6d2b1ba60e9/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6a61736e792f64622e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/jasny/invite-code)

This library can be used for requiring invitation codes at registration. This is often the case when an application is in private beta phase.

### Installation

[](#installation)

This library is registred at packagist as [jasny/invite-code](https://packagist.org/packages/jasny/invite-code) and can be easily installed using [composer](http://getcomposer.org/).

```
composer require jasny/invite-code

```

### Generation

[](#generation)

To create 100 random invitation codes run the following on the command line

```
mkdir invite-codes
cd invite-codes
for i in {1..100}; do
   CODE=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'A-Z0-9' | fold -w 8 | head -n 1)
   touch $CODE
   echo $CODE
done

```

### Usage

[](#usage)

```
Jasny\InviteCode::setDir('invite-codes');

$invite = new Jasny\InviteCode($_POST['invite']);

if (!$invite->isValid()) {
    echo "Invalid invite code";
    exit();
}

if ($invite->isUsed()) {
    echo "Invite code is already used";
    exit();
}

$invite->useBy($_POST['name']);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

2091d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3379a93d51305df325df9045e1a8b205d195e4e8c01312dff53a000ee79002eb?d=identicon)[jasny](/maintainers/jasny)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jasny-invite-code/health.svg)

```
[![Health](https://phpackages.com/badges/jasny-invite-code/health.svg)](https://phpackages.com/packages/jasny-invite-code)
```

PHPackages © 2026

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