Merge pull request #4215 from sileence/patch-4
[5.6] Update authorization.md
This commit is contained in:
commit
bbd0c27112
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue