Skip to content

Commit 5664a0f

Browse files
Grammar and composer instructions (#11)
1 parent 0c77010 commit 5664a0f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
# Read Only Laravel 5 Models
2-
The Read only trait Monkey Patches Laravel models to not save, delete or modify models.
3-
Ideally, this would be used in addition to DB permissions to ensure Users and Developers cannot write to a Legacy system of some kind.
1+
# Laravel 5+ Read Only Models
2+
The read only trait removes the ability to save, delete or modify Laravel models.
3+
Ideally, this would be used in addition to DB permissions to ensure users and developers cannot write to a Legacy system.
4+
5+
## Install
6+
7+
```
8+
composer require michaelachrisco/readonly
9+
```
410

5-
This is only a simple demonstration of the model.
611
## To use:
712

13+
14+
815
```php
916
<?php
10-
require_once('src/ReadOnlyTrait.php'); //Or register under your config/App.php
11-
// use MichaelAChrisco\ReadOnlyTrait; //optional
1217
use Illuminate\Database\Eloquent\Model;
1318
class User extends Model {
14-
use MichaelAChrisco\ReadOnly\ReadOnlyTrait;
19+
use \MichaelAChrisco\ReadOnly\ReadOnlyTrait;
1520
}
1621

1722
$legacyUser = new User;

0 commit comments

Comments
 (0)