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

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

repat/immutability
==================

A simple Laravel package based on davidmpeace/immutability that allows you to enforce immutable attributes on Eloquent models.

0.3(7y ago)1444MITPHPPHP &gt;=5.4.0

Since Apr 22Pushed 7y ago2 watchersCompare

[ Source](https://github.com/repat/immutability)[ Packagist](https://packagist.org/packages/repat/immutability)[ RSS](/packages/repat-immutability/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

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

[](#immutability)

*repat/immutability* is a simple package based on *davidmpeace/immutability* that is used in your Eloquent models to enforce attribute immutability. Immutable attributes may be only set if they are `!= null`, 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.

```
