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

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

dylan-chapman/immutability
==========================

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

0.5(3y ago)08.9kMITPHPPHP &gt;=7.2

Since Apr 22Pushed 3y agoCompare

[ Source](https://github.com/Dylan-Chapman/immutability)[ Packagist](https://packagist.org/packages/dylan-chapman/immutability)[ RSS](/packages/dylan-chapman-immutability/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (7)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 dylan-chapman/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.

```
