PHPackages                             pratikkuikel/wasabi - 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. pratikkuikel/wasabi

ActiveLibrary

pratikkuikel/wasabi
===================

Laravel Json column keys to model attributes

2.1(1y ago)6127[4 PRs](https://github.com/pratikkuikel/wasabi/pulls)MITPHPPHP ^8.1CI passing

Since Jan 10Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/pratikkuikel/wasabi)[ Packagist](https://packagist.org/packages/pratikkuikel/wasabi)[ Docs](https://github.com/pratikkuikel/wasabi)[ GitHub Sponsors](https://github.com/pratikkuikel)[ RSS](/packages/pratikkuikel-wasabi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (8)Used By (0)

This is my package wasabi
=========================

[](#this-is-my-package-wasabi)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8e71152793efce0a44572f5ea5a934e8566e27bdbf3364e9b318475b6e6a02a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726174696b6b75696b656c2f7761736162692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pratikkuikel/wasabi)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e4827d96ec6e890b07b3554836c8ba62e1dd61408d432f378df4d852f5d6ab75/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70726174696b6b75696b656c2f7761736162692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/pratikkuikel/wasabi/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/819af43562857d975619c1d64098cd002df8bac43b25f598695856872bda1d9e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70726174696b6b75696b656c2f7761736162692f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/pratikkuikel/wasabi/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/546cd0430cda100a3084c941ced12bbc28e43ac054425d97e581be75a8027635/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70726174696b6b75696b656c2f7761736162692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pratikkuikel/wasabi)

This package converts the level one json column keys to the attributes of the model whenever the data is retrieved from the database using eloquent. It works only on retrieval.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require pratikkuikel/wasabi
```

Usage
-----

[](#usage)

```
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Pratikkuikel\Wasabi\Traits\Wasabi;

class State extends Model
{
    use HasFactory;
    use Wasabi;

    protected $guarded = [];

    protected $casts = [
        'data' => 'array'
    ];

    // OR
    // protected $casts = [
    //     'custom_field' => 'array'
    // ];

    // you don't need to define the constructor to use the default `data` field
    public function __construct(array $attributes = [])
    {
    // set wasabi's status false based on some condtions
        if($condition)
        {
         static::setWasabiStatus(true);
        }

    // Override the default dataField with any other preferred name
         static::setDataField('custom_field');

    // construct parent after setting data and status
         parent::__construct($attributes);
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [pratik kuikel](https://github.com/pratikkuikel)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance67

Regular maintenance activity

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~133 days

Total

3

Last Release

586d ago

Major Versions

1.1.0 → 2.12024-10-03

### Community

Maintainers

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

---

Top Contributors

[![pratikkuikel](https://avatars.githubusercontent.com/u/35728183?v=4)](https://github.com/pratikkuikel "pratikkuikel (28 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

laravelwasabipratikkuikel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/pratikkuikel-wasabi/health.svg)

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

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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