PHPackages                             awssat/laravel-kabsa - 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. [Caching](/categories/caching)
4. /
5. awssat/laravel-kabsa

ActiveLibrary[Caching](/categories/caching)

awssat/laravel-kabsa
====================

Laravel Array database

v1.5(3y ago)445111MITPHPPHP ^7.3|^8.0CI failing

Since Mar 9Pushed 3y ago2 watchersCompare

[ Source](https://github.com/awssat/laravel-kabsa)[ Packagist](https://packagist.org/packages/awssat/laravel-kabsa)[ Docs](https://github.com/awssat/laravel-kabsa)[ RSS](/packages/awssat-laravel-kabsa/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (7)Versions (9)Used By (0)

Laravel Kabsa 🍗
===============

[](#laravel-kabsa-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/564cd66ca5cc4b6ab4b4a8f5fe5b67003c89d2265745d545d8ff1ae8351a979a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6177737361742f6c61726176656c2d6b616273612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/awssat/laravel-kabsa)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/1a216ffcbb73e109d24161c43adf25615caaa49317593e50173eec51ca2a11b8/68747470733a2f2f7472617669732d63692e6f72672f6177737361742f6c61726176656c2d6b616273612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/awssat/laravel-kabsa)[![Quality Score](https://camo.githubusercontent.com/ee3d2c325ddd280f4b0b37a078d778847744fc39ee26202c9a3f9589c6d5b059/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6177737361742f6c61726176656c2d6b616273612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/awssat/laravel-kabsa)[![Total Downloads](https://camo.githubusercontent.com/82bc6cd3fd59073ad7490fedd8695cde2a5675dad87f0451e7cb86222c25fec5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6177737361742f6c61726176656c2d6b616273612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/awssat/laravel-kabsa)

Laravel Kabsa is a simple array trait for your Eloquent model just like  without SQLite

Install
-------

[](#install)

To get started with Laravel Kabsa, use Composer to add the package to your project's dependencies:

```
composer require awssat/laravel-kabsa
```

Examples
--------

[](#examples)

Code examples available [see: examples](EXAMPLES.md)

Use
---

[](#use)

1. Add the `Kabsa` trait to a model.
2. Add a `$rows` property to the model.

```
class State extends Model
{
    use \Awssat\Kabsa\Traits\Kabsa;

    protected $rows = [
        [
            'abbr' => 'NY',
            'name' => 'New York',
        ],
        [
            'abbr' => 'CA',
            'name' => 'California',
        ],
    ];
}
```

or

```
class State extends Model
{
    use \Awssat\Kabsa\Traits\Kabsa;

    public function getRows()
    {
        return [
            [
                'abbr' => 'NY',
                'name' => 'New York',
            ],
            [
                'abbr' => 'CA',
                'name' => 'California',
            ],
        ];
    }
}
```

Now, you can use this model anywhere you like, and it will behave as if you created a table with the rows you provided.

```
$stateName = State::where('Abbr', 'NY')->first()->name;

// or
$stateName = State::firstWhere('Abbr', 'NY')->name;
```

### Relationships

[](#relationships)

```
class Role extends Model
{
    use \Awssat\Kabsa\Traits\Kabsa;

    protected $rows = [
        ['label' => 'admin'],
        ['label' => 'manager'],
        ['label' => 'user'],
    ];
}
```

You can add a relationship to another standard model with help of new trait called `KabsaRelationships` right now I have just added two relationships hope we add more

```
class User extends Model
{
    use \Awssat\Kabsa\Traits\KabsaRelationships;

    public function role()
    {
        return $this->belongsToKabsaRow(Role::class, 'role_label', 'label');
    }
}
```

the `users` table should have a `role_label` column, then:

```
// Grab a User.
$user = User::first();
// Grab a Role.
$role = Role::where('label', 'admin')->first();

// Associate them.
$user->role()->associate($role);

// Access like normal.
$user->role;
```

Eager loading doesn't work because it's a collection you don't need eager load you can call the relation `->relation` directly. If you need it to be appended to the collection array you can create an attribute and add it to $appends.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.5% 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 ~128 days

Recently: every ~220 days

Total

8

Last Release

1354d ago

Major Versions

v0.2 → v1.02020-03-29

PHP version history (2 changes)v0.1PHP ^7.2

v1.4PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d1839100c9cfd19f7ae04492a1c0b08c09e0956479f7a1dc4006de315c0f62e?d=identicon)[if4lcon](/maintainers/if4lcon)

---

Top Contributors

[![BSN4](https://avatars.githubusercontent.com/u/199647?v=4)](https://github.com/BSN4 "BSN4 (37 commits)")[![zoispag](https://avatars.githubusercontent.com/u/21138205?v=4)](https://github.com/zoispag "zoispag (3 commits)")

---

Tags

laravelcache

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/awssat-laravel-kabsa/health.svg)

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

1317.7k](/packages/nexxai-laravel-cfcache)[omaralalwi/lexi-translate

Laravel translation package with morph relationships and caching.

754.3k2](/packages/omaralalwi-lexi-translate)[karriere/state

Laravel package for storing current application state in cache/session

1718.5k](/packages/karriere-state)

PHPackages © 2026

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