PHPackages                             vima/core - 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. vima/core

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

vima/core
=========

Framework-agnostic RBAC + ABAC access control engine with pluggable storage backends and a built-in CLI.

v0.2.7(1mo ago)049↓50%[3 issues](https://github.com/vimaphp/vima-core/issues)1MITPHPPHP &gt;=8.1

Since Sep 18Pushed 1mo agoCompare

[ Source](https://github.com/vimaphp/vima-core)[ Packagist](https://packagist.org/packages/vima/core)[ RSS](/packages/vima-core/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (25)Used By (1)

Vima Core
=========

[](#vima-core)

**Vima Core** is a framework-agnostic foundation for building robust **Role-Based Access Control (RBAC)** and **Attribute-Based Access Control (ABAC)** systems in PHP.

Unlike consumer-facing packages, Vima Core is designed specifically for **framework developers** and **system architects**. It provides a "Contract-First" toolkit that you can integrate into your framework's identity and storage systems.

🎯 Target Audience
-----------------

[](#-target-audience)

- **Framework Integrators**: Building bridges for Laravel, Tempest, CodeIgniter, etc.
- **Library Authors**: Requiring a lightweight, testable authorization foundation.
- **Enterprise Architects**: Designing custom, decoupled security architectures.

✨ Core Features
---------------

[](#-core-features)

- 🧩 **Contract-First Design**: Decoupled from storage and framework specifics.
- 🔑 **Entity Foundation**: Standardized `User`, `Role`, and `Permission` entities.
- 📜 **Unified Access Manager**: A single entry point for both RBAC and ABAC checks.
- ⚙️ **Flexible Policies**: Class-based and closure-based ABAC support.
- 🏗️ **Schema-Driven**: Typed DTOs for automated storage and migration setup.
- 🌐 **Namespacing &amp; Context**: Support for isolated roles and contextual authorization (e.g. multi-tenant).
- 🧪 **Testable**: Designed with dependency injection and PSR-11 compliance.
- 📡 **Event-Driven**: Hook into system actions, sync operations, and repository changes.

📦 Installation
--------------

[](#-installation)

```
composer require vima/core
```

🔧 Technical Overview
--------------------

[](#-technical-overview)

Vima Core provides the logic; you provide the implementation.

### 1. Register Implementation Contracts

[](#1-register-implementation-contracts)

As a framework integrator, you implement the storage interfaces (Repositories) and register them in the Vima container.

```
use Vima\Core\Contracts\RoleRepositoryInterface;
use Vima\Core\Contracts\PermissionRepositoryInterface;
use function Vima\Core\registerMany;

registerMany([
    RoleRepositoryInterface::class => new YourDatabaseRoleRepository(),
    PermissionRepositoryInterface::class => new YourDatabasePermissionRepository(),
    // ... other repositories
]);
```

### 2. Authorization Checks

[](#2-authorization-checks)

Once set up, authorization is simple and consistent.

```
use Vima\Core\Services\AccessManager;
use function Vima\Core\resolve;

$vima = resolve(AccessManager::class);

// RBAC Check
if ($vima->can($user, 'posts.edit')) {
    // Authorized...
}

// ABAC Check (with context)
if ($vima->can($user, 'posts.edit', null, $post)) {
    // Authorized based on policy logic...
}
```

### 3. Defining Policies (ABAC)

[](#3-defining-policies-abac)

Policies are class-based rules for specific resources.

```
use Vima\Core\Contracts\PolicyInterface;

class PostPolicy implements PolicyInterface {
    public function canEdit(User $user, Post $post) {
        return $user->id === $post->userId;
    }
}

$vima->registerPolicy(Post::class, PostPolicy::class);
```

📚 Documentation
---------------

[](#-documentation)

Detailed guides for deep integration:

- [**Architecture Overview**](docs/architecture.md) – Understand the design and "The Vima Way".
- [**Integration Guide**](docs/integration.md) – Step-by-step instructions for framework developers.
- [**Event System**](docs/events.md) – Hook into internal Vima operations and actions.

📂 Package Structure
-------------------

[](#-package-structure)

```
src/
 ├── Contracts/         # Persistent layer and service interfaces
 ├── Entities/          # Core security data structures
 ├── Services/          # AccessManager, PolicyRegistry, and Managers
 ├── Support/           # Framework integration helpers
 └── DependencyContainer.php # Vima's PSR-11 container

```

📜 License
---------

[](#-license)

This package is part of **Vima PHP** and is released under the MIT License.

---

(c) Vima PHP

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance89

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

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

Total

24

Last Release

57d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a00939d7e5422a294a7b9b186f29116de3dca2d793453c8c58c0293bd2346b2?d=identicon)[gilads-otiannoh254](/maintainers/gilads-otiannoh254)

---

Top Contributors

[![gilads-otiannoh24](https://avatars.githubusercontent.com/u/180090128?v=4)](https://github.com/gilads-otiannoh24 "gilads-otiannoh24 (31 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/vima-core/health.svg)

```
[![Health](https://phpackages.com/badges/vima-core/health.svg)](https://phpackages.com/packages/vima-core)
```

###  Alternatives

[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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