PHPackages                             navaint1876/gf-identity - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. navaint1876/gf-identity

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

navaint1876/gf-identity
=======================

1.4(6y ago)019mitPHPPHP ^7.1.0

Since Aug 31Pushed 6y ago1 watchersCompare

[ Source](https://github.com/NavaINT1876/gf-identity)[ Packagist](https://packagist.org/packages/navaint1876/gf-identity)[ RSS](/packages/navaint1876-gf-identity/feed)WikiDiscussions master Synced 2mo ago

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

### GF Identity reusable package

[](#gf-identity-reusable-package)

Package is used for access management in EVA Micro Services.

### Usage

[](#usage)

EvaGuard is a trait for checking access by roles and possibly by additional custom logic provided in instance of VoterInterface.

Usage:

In controller we import EvaGuard using expression `use EvaGuard;`Then we're able to use it's functionality in any action or `checkAccess()` method, for example:

`self::denyAccessUnlessGranted('ROLE_ADMIN');`

Interface VoterInterface stands for decision making point whether to grant access to user or not. It is possible to add some logic and conditions to class which implements this interface to check for additional requirements.

Instance can be passed to NavaINT1876\\GfIdentity\\EvaGuard::denyAccessUnlessGranted() as a second argument, and $params for it as a third argument.

Example of usage:

```
 public function checkAccess($action, $model = null, $params = [])
 {
     if ('index' === $action) {
         self::denyAccessUnlessGranted('ROLE_ADMIN');
     }

     if ('view' === $action || 'update' === $action) {
         self::denyAccessUnlessGranted('ROLE_USER', UserVoter::class, ['model' => $model, 'action' => $action]);
     }
 }
```

Example of voter:

```
 namespace app\modules\v1\voters;

 use Yii;
 use yii\web\ForbiddenHttpException;

 class UserVoter implements VoterInterface
 {
     const ACTION_VIEW = 'view';

     const ACTION_EDIT = 'update';

     const ACTIONS = [
         self::ACTION_VIEW,
         self::ACTION_EDIT,
     ];

     private $params;

     public function __construct(array $params)
     {
         $this->params = $params;
     }

     public function decide(): void
     {
         $action = $this->params['action'];
         $subject = $this->params['model'];
         $currentUser = Yii::$app->identity->getUser();

         if ($currentUser->id === $subject->id && in_array($action, self::ACTIONS)) {
             return;
         }

         throw new ForbiddenHttpException('You do not have permission to view/edit this user details.');
     }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

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 ~4 days

Total

5

Last Release

2428d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/navaint1876-gf-identity/health.svg)

```
[![Health](https://phpackages.com/badges/navaint1876-gf-identity/health.svg)](https://phpackages.com/packages/navaint1876-gf-identity)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)[stechstudio/laravel-jwt

Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel

126117.6k](/packages/stechstudio-laravel-jwt)[nl.idaas/openid-server

OpenID Connect server for PHP

47129.2k1](/packages/nlidaas-openid-server)

PHPackages © 2026

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