Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
santigarcor committed Oct 2, 2017
1 parent 7da556a commit 6904aa5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/upgrade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In order to upgrade from Laratrust 4.0 to 5.0 you have to follow these steps:
- ``use Laratrust\LaratrustPermission`` to ``use Laratrust\Models\LaratrustPermission``;
- ``use Laratrust\LaratrustTeam`` to ``use Laratrust\Models\LaratrustTeam``;

6. If you use the ability method and pass coma separated roles or permissions, change them to a pipe separated string:
6. If you use the ability method and you pass it comma separated roles or permissions, change them to a pipe separated string:

.. code-block:: php
Expand Down
6 changes: 2 additions & 4 deletions docs/usage/middleware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ The middlewares are registered automatically as ``role``, ``permission`` and ``a
'permission' => \Laratrust\Middleware\LaratrustPermission::class,
'ability' => \Laratrust\Middleware\LaratrustAbility::class,

asdfasdfasd

Concepts
^^^^^^^^

Expand Down Expand Up @@ -46,7 +44,7 @@ To emulate *AND* functionality you can do:
'middleware' => ['permission:edit-post|edit-user,require_all']
// $user->can(['edit-post', 'edit-user'], true);
For more complex situations use ``ability`` middleware which accepts 3 parameters: roles, permissions, validate_all:
For more complex situations use ``ability`` middleware which accepts 3 parameters; roles, permissions and options:

.. code-block:: php
Expand All @@ -58,7 +56,7 @@ If you want yo use a different guard for the user check you can specify it as an
.. code-block:: php
'middleware' => ['role:owner|writer,require_all|guard:api']
'middleware' => ['permission:edit-post|edit-user,require_all|guard:some_new_guard']
'middleware' => ['permission:edit-post|edit-user,guard:some_new_guard']
'middleware' => ['ability:admin|owner,create-post|edit-user,require_all|guard:web']
Teams
Expand Down

0 comments on commit 6904aa5

Please sign in to comment.