PHPackages                             davidmpeace/immutability - 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. davidmpeace/immutability

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

davidmpeace/immutability
========================

A simple Laravel package that allows you to enforce immutable attributes on Eloquent models.

0.2(10y ago)620.5k4[1 PRs](https://github.com/davidmpeace/immutability/pulls)MITPHPPHP &gt;=5.4.0

Since Apr 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/davidmpeace/immutability)[ Packagist](https://packagist.org/packages/davidmpeace/immutability)[ RSS](/packages/davidmpeace-immutability/feed)WikiDiscussions master Synced 2mo ago

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

Immutability
============

[](#immutability)

Immutability is a simple package that is used in your Eloquent models to enforce attribute immutability. Immutable attributes may be set, and changed once, but once the model is saved, the value can not be changed.

License
-------

[](#license)

Immutability is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

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

[](#installation)

To get started with Immutability, add to your `composer.json` file as a dependency:

```
composer require davidmpeace/immutability

```

### Basic Usage

[](#basic-usage)

To use the Immutability library, you simply need to use the Immutability trait for any model you wish to identify immutable attributes for. Typically, you would want to implement the trait in your super-class so that all your sub-classes will automatically inherit the functionality.

```
