Skip to content

Commit

Permalink
[6.x] Use the policies() method instead of the property policies (#30189
Browse files Browse the repository at this point in the history
)

This change allows to use the *unused* `policies()` method and also to do something like this:

```php
   /**
     * Get the policies defined on the provider.
     *
     * @return array
     */
    public function policies()
    {
        return config('policies', []);
    }
```
  • Loading branch information
arcanedev-maroc authored and taylorotwell committed Oct 7, 2019
1 parent b697c2d commit 6169acc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AuthServiceProvider extends ServiceProvider
*/
public function registerPolicies()
{
foreach ($this->policies as $key => $value) {
foreach ($this->policies() as $key => $value) {
Gate::policy($key, $value);
}
}
Expand Down

0 comments on commit 6169acc

Please sign in to comment.