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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pratikkuikel/wasabi

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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

Laravel Json column keys to model attributes

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

Since Jan 10Pushed 3mo 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 today

READMEChangelog (3)Dependencies (12)Versions (9)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

38

—

LowBetter than 83% of packages

Maintenance61

Regular maintenance activity

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

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

638d 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

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

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