From 8ae5c63265a3f23edbadd1a5a7a418a505229ad1 Mon Sep 17 00:00:00 2001 From: uwla Date: Sat, 29 Apr 2023 16:15:41 -0300 Subject: [PATCH] format README --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2e8778a..250c1c8 100644 --- a/README.md +++ b/README.md @@ -310,7 +310,7 @@ class Article extends Model implements PermissionableContract Here is a summary of the auxilary methods provided by `Permissionable`: | Name | Description | -| :------------------------- | :---------------------------------------------------------------------------- | +| :------------------------- | :--------------------------------------------------------------------------------- | | `createViewPermission` | Create permission for viewing the model. | | `createUpdatePermission` | Create permission for updating the model. | | `createDeletePermission` | Create permission for deleting the model. | @@ -391,7 +391,7 @@ Attach the permissions to the user: ```php getViewPermission(); $role->addPermission($viewPermission); // assign to a role $user->addPermission($viewPermission); // assign to a specific user @@ -400,7 +400,7 @@ $crudPermissions = $article->getCrudPermissions(); $user->addPermissions($crudPermissions); $role->addPermissions($crudPermissions); -// it is easier to attach them via the model +// but it is easier to attach them via the model $article->attachViewPermission($role); $article->attachViewPermission($user); @@ -467,13 +467,14 @@ with the `Permissionable` trait. $model->deletetThisModelPermissions(); ``` -If you want that behavior to be triggered automatically before deleting an Eloquent -model, you can add that to the `boot` method of your model: +If you want that behavior to be triggered automatically before deleting an +Eloquent model, you can add that to the `boot` method of your model: ```php getModels(Article::class); $articles = $role->getModels(Article::class); ``` -This will fetch all `Article` models such that there is a per-model permission -associated with them and the user or role has access to at least one of such +This will fetch all `Article` models such that there is a per-model permission +associated with them and the user or role has access to at least one of such per-model permissions. You can specify the name of the permission too: