Grammar and composer instructions (#11)

This commit is contained in:
michaelachrisco 2017-02-08 12:51:15 -08:00 committed by GitHub
parent 0c770109cb
commit 5664a0f191

View file

@ -1,17 +1,22 @@
# Read Only Laravel 5 Models # Laravel 5+ Read Only Models
The Read only trait Monkey Patches Laravel models to not save, delete or modify models. The read only trait removes the ability to save, delete or modify Laravel models.
Ideally, this would be used in addition to DB permissions to ensure Users and Developers cannot write to a Legacy system of some kind. Ideally, this would be used in addition to DB permissions to ensure users and developers cannot write to a Legacy system.
## Install
```
composer require michaelachrisco/readonly
```
This is only a simple demonstration of the model.
## To use: ## To use:
```php ```php
<?php <?php
require_once('src/ReadOnlyTrait.php'); //Or register under your config/App.php
// use MichaelAChrisco\ReadOnlyTrait; //optional
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class User extends Model { class User extends Model {
use MichaelAChrisco\ReadOnly\ReadOnlyTrait; use \MichaelAChrisco\ReadOnly\ReadOnlyTrait;
} }
$legacyUser = new User; $legacyUser = new User;