title: Guest users in laravel authorization policies
body: <p>I use <a href="https://laravel.com/docs/5.3/authorization#creating-policies" rel="nofollow">policies</a> for user authorization. How to use policies for guest users?</p>
  
  <p>Here is my code:</p>
  
  <p>In controller:</p>
  
  <pre><code>class PostController extends Controller
  {
      public function index(Post $post)
      {
          $this-&gt;authorize($post);
          return $post-&gt;all();
      }
  }
  </code></pre>
  
  <p>In policy:</p>
  
  <pre><code>class PostPolicy
  {
      // This function executes only for authenticated users.
      // I want to use it for guest users too
      public function index(User $user)
      {            
          return $user-&gt;can('get-posts');
      }
  }
  </code></pre>