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.0(1y ago)18202MITPHPPHP ^8.1

Since Nov 27Pushed 1y 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 yesterday

READMEChangelog (4)Dependencies (5)Versions (19)Used By (2)

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

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

[![Build Status](https://camo.githubusercontent.com/02268bf3d801ac3c96aaa5a8cdeeaaa4010481f267922b175f7d639e9ab00816/68747470733a2f2f7472617669732d63692e6f72672f6d696e6474776f2f6c61726176656c2d64796e616d69632d6d6f64656c2d6d757461746f72732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mindtwo/laravel-dynamic-model-mutators)[![StyleCI](https://camo.githubusercontent.com/66078b05c94947a63ddb70c71b8fa2127d673e49ab8b519c0a0d7d07c40bf032/68747470733a2f2f7374796c6563692e696f2f7265706f732f3135393336383139342f736869656c64)](https://styleci.io/repos/159368194)[![Quality Score](https://camo.githubusercontent.com/e0693ae11928d6d9660caa1a9499e6e9049ea12ba426825cc31ac182334482d6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d696e6474776f2f6c61726176656c2d64796e616d69632d6d6f64656c2d6d757461746f72732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mindtwo/laravel-dynamic-model-mutators)[![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:

```
