PHPackages                             echoaro/laravel-json-mutator - 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. [Database &amp; ORM](/categories/database)
4. /
5. echoaro/laravel-json-mutator

ActiveLibrary[Database &amp; ORM](/categories/database)

echoaro/laravel-json-mutator
============================

A Laravel package for easy JSON metadata management with custom casts

v0.0.2-alpha(8mo ago)17MITPHPPHP ^8.2CI passing

Since Sep 2Pushed 8mo agoCompare

[ Source](https://github.com/echoaro/laravel-json-mutator)[ Packagist](https://packagist.org/packages/echoaro/laravel-json-mutator)[ Docs](https://github.com/echoaro/laravel-json-mutator)[ RSS](/packages/echoaro-laravel-json-mutator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Laravel JSON Mutator
====================

[](#laravel-json-mutator)

[![Packagist](https://camo.githubusercontent.com/fe0f7bc2d8f6e8e27c646afbf3e9e7561c2d954aa567a536e61777a609b5d3ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6563686f61726f2f6c61726176656c2d6a736f6e2d6d757461746f722e737667)](https://packagist.org/packages/echoaro/laravel-json-mutator)[![Downloads](https://camo.githubusercontent.com/175b53b3c3bf7217143e1e6925476dbc787d45e2f1256726d3fdf1039a2b0510/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6563686f61726f2f6c61726176656c2d6a736f6e2d6d757461746f722e737667)](https://packagist.org/packages/echoaro/laravel-json-mutator)[![License](https://camo.githubusercontent.com/11c4bb82afdafea63a0a553847a7e62ffd2c98cfd25098f78ec7aa11eed7b78d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6563686f61726f2f6c61726176656c2d6a736f6e2d6d757461746f722e737667)](LICENSE.md)[![Tests](https://github.com/echoaro/laravel-json-mutator/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/echoaro/laravel-json-mutator/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/66d9ff64f17db583b22fd9d17060d428570e4fdd8d61bc840ee4e3480709f862/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6563686f61726f2f6c61726176656c2d6a736f6e2d6d757461746f722e737667)](https://packagist.org/packages/echoaro/laravel-json-mutator)[![Laravel Framework](https://camo.githubusercontent.com/3ba98a43466eb2f532b00a0cc237b1d10db53896dc26bfe7e7518d59be295d83/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6563686f61726f2f6c61726176656c2d6a736f6e2d6d757461746f722f6c61726176656c2f6672616d65776f726b2e737667)](https://packagist.org/packages/echoaro/laravel-json-mutator)

A powerful Laravel package for easy JSON metadata management with custom casts, dot notation support, and fluent interface.

Features
--------

[](#features)

- **Easy JSON Management**: Simple and intuitive API for managing JSON metadata
- **Dot Notation Support**: Access nested data using dot notation (e.g., `user.profile.name`)
- **Fluent Interface**: Chain methods for better readability
- **Type Safety**: Full type hints and return type declarations
- **Array Access**: Use array syntax for accessing metadata
- **Laravel Integration**: Seamless integration with Laravel Eloquent models
- **Laravel 11+ &amp; 12 Support**: New Attribute-based cast for better compatibility
- **Comprehensive Testing**: Full test coverage with PHPUnit

Quick Links
-----------

[](#quick-links)

- **[📋 Documentation](https://github.com/echoaro/laravel-json-mutator#readme)** - Full documentation
- **[🐛 Issues](https://github.com/echoaro/laravel-json-mutator/issues)** - Report bugs
- **[💡 Discussions](https://github.com/echoaro/laravel-json-mutator/discussions)** - Ask questions

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

[](#installation)

You can install the package via Composer:

```
composer require echoaro/laravel-json-mutator
```

The package will automatically register itself with Laravel.

### Requirements

[](#requirements)

- **PHP**: ^8.2
- **Laravel**: ^10.0|^11.0|^12.0

Basic Usage
-----------

[](#basic-usage)

### 1. Add the Cast to Your Model

[](#1-add-the-cast-to-your-model)

#### Option 1: Traditional Cast (Laravel 10+)

[](#option-1-traditional-cast-laravel-10)

```
