Merge pull request #4215 from sileence/patch-4

[5.6] Update authorization.md
This commit is contained in:
Taylor Otwell 2018-04-09 09:01:23 -07:00 committed by GitHub
commit bbd0c27112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ This is identical to manually defining the following Gate definitions:
Gate::define('posts.update', 'App\Policies\PostPolicy@update');
Gate::define('posts.delete', 'App\Policies\PostPolicy@delete');
By default, the `view`, `create`, `update`, and `delete` abilities will be defined. You may override or add to the default abilities by passing an array as a third argument to the `resource` method. The keys of the array define the names of the abilities while the values define the method names. For example, the following code will create two new Gate definitions - `posts.image` and `posts.photo`:
By default, the `view`, `create`, `update`, and `delete` abilities will be defined. You may override the default abilities by passing an array as a third argument to the `resource` method. The keys of the array define the names of the abilities while the values define the method names. For example, the following code will only create two new Gate definitions - `posts.image` and `posts.photo`:
Gate::resource('posts', 'PostPolicy', [
'image' => 'updateImage',