From d5b1df52b1f2dde596c07c681e9be286a40d43a9 Mon Sep 17 00:00:00 2001 From: Ben Batschelet Date: Tue, 13 Jan 2015 16:05:04 -0600 Subject: [PATCH] Update README.md Typos and cleanup --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 50bffb98..7a2e2bb4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Entrust is a succinct and flexible way to add Role-based Permissions to **Laravel4**. -First and foremost I must give credit to the original developers of this package. Andrew Elkins (@andrewelkins) and Leroy Merlin (@zizaco) did excellent on the fundamental design and functionality. My fork is intended to: +First and foremost I must give credit to the original developers of this package. Andrew Elkins (@andrewelkins) and Leroy Merlin (@zizaco) did excellent work on the fundamental design and functionality. My fork is intended to: - Remove extra components not really relevant to role & permission management (in particular, Ardent). - Add extra functionality I felt was useful and particularly suited to this package. @@ -182,8 +182,11 @@ $editUser->display_name = 'Edit Users'; // optional $editUser->description = 'edit existing users'; // optional $editUser->save(); -$owner->perms()->sync(array($createPost->id, $editUser->id)); -$admin->perms()->sync(array($createPost->id)); +$admin->attachPermission($createPost); +// Equivalent to $admin->perms()->sync(array($createPost->id)); + +$owner->attachPermissions(array($createPost, $editUser)); +// Equivalent to $owner->perms()->sync(array($createPost->id, $editUser->id)); ``` #### Checking for Roles & Permissions