title: Spatie/Laravel-Permission mapping permissions with controller methods
body: <p>does anyone know a way of mapping the controller methods with permissions authorisation?</p>
  <p>Let's say that I have 20 controllers, with <code>index</code>,<code>store</code>,<code>show</code> and <code>delete</code> methods and I don't wanna put in each method of this controller the correspondent permission, just for the sake of ... DRY.</p>
  <p>What I wanna do instead is trying to map the permissions with controller actions.</p>
  <p>An example would be:</p>
  <p><a href="https://laravel.com/docs/5.5/authorization#writing-gates" rel="nofollow noreferrer">https://laravel.com/docs/5.5/authorization#writing-gates</a></p>
  <blockquote>
  <p>Gate::resource('posts', 'PostPolicy');</p>
  <p>This is identical to manually defining the following Gate definitions:</p>
  <p>Gate::define('posts.view', 'PostPolicy@view');</p>
  <p>Gate::define('posts.create', 'PostPolicy@create');</p>
  <p>Gate::define('posts.update', 'PostPolicy@update');</p>
  <p>Gate::define('posts.delete', 'PostPolicy@delete');</p>
  </blockquote>
  <p>for me something like this would fit:</p>
  <pre><code>Permission::map('route', 'permission');
  Permission::map('users.store', 'create-user');
  </code></pre>
  <p>or even better</p>
  <pre><code>Permission::mapResource('users', '????');
  </code></pre>