PHPackages                             mindtwo/laravel-dynamic-model-mutators - 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. mindtwo/laravel-dynamic-model-mutators

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

mindtwo/laravel-dynamic-model-mutators
======================================

Laravel Dynamic Model Mutators

4.1.0(1mo ago)18202MITPHPPHP ^8.2CI passing

Since Nov 27Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/mindtwo/laravel-dynamic-model-mutators)[ Packagist](https://packagist.org/packages/mindtwo/laravel-dynamic-model-mutators)[ RSS](/packages/mindtwo-laravel-dynamic-model-mutators/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (10)Versions (20)Used By (2)

Laravel Dynamic Model Mutators
==============================

[](#laravel-dynamic-model-mutators)

[![Tests](https://github.com/mindtwo/laravel-dynamic-model-mutators/actions/workflows/tests.yml/badge.svg)](https://github.com/mindtwo/laravel-dynamic-model-mutators/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/8a9ad26501c85f0d6509ec781e184af5d75237d8dcb148683c367e2bb827ece4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696e6474776f2f6c61726176656c2d64796e616d69632d6d6f64656c2d6d757461746f72733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mindtwo/laravel-dynamic-model-mutators)[![Total Downloads](https://camo.githubusercontent.com/48e9e79ab6f17067a58414fcdf3e5347bcf4a975c2f9ab7b4814604492d70ff0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696e6474776f2f6c61726176656c2d64796e616d69632d6d6f64656c2d6d757461746f72733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mindtwo/laravel-dynamic-model-mutators)[![MIT Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

> ## Important Notice:
>
> [](#important-notice)
>
> The following documentation refers to packacke version 1.x
> We will add documentation for version 2.x as soon as possible. Sorry.

Introduction
------------

[](#introduction)

This package is an extension for Laravel's eloquent model. It allows you to define multiple get and set mutators by registering your own callback functions. This is a simple way to inject Laravel's getAttribute() and setAttribute() methods, especially within different traits on a single model.

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

[](#installation)

You can install the package via composer:

```
composer require mindtwo/laravel-dynamic-model-mutators
```

How to use?
-----------

[](#how-to-use)

Use the "DynamicModelMutator" trait in your eloquent models:

```
