title: $this->registerPolicies method in AppServiceProvider not found for Passport in Laravel
body: <p>I am developing an REST api using Laravel. What I am trying to do now is installing the Passport. I am using Laravel 5.4 version because I am maintaining a legacy system. I integrated the Passport following this official docs - <a href="https://laravel.com/docs/5.4/passport" rel="nofollow noreferrer">https://laravel.com/docs/5.4/passport</a>. But I am getting an error.</p>
  
  <p>First I installed the Passport running this composer command</p>
  
  <pre><code>composer require laravel/passport:~4.0
  </code></pre>
  
  <p>Then I added this provider class to the config/app.php file</p>
  
  <pre><code>Laravel\Passport\PassportServiceProvider::class,
  </code></pre>
  
  <p>Then I run these commands</p>
  
  <pre><code>php artisan migrate
  php artisan passport:install
  </code></pre>
  
  <p>Which was fine because it gave me the expected output.</p>
  
  <p>Then I modified the app\User class. This is the User.php</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  
  use Laravel\Passport\HasApiTokens;
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      use HasApiTokens, Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name', 'email', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  }
  </code></pre>
  
  <p>Then I modified the guards section of config/auth.php as follow.</p>
  
  <pre><code> 'guards' =&gt; [
        'web' =&gt; [
           //'driver' =&gt; 'session',
           'driver' =&gt; 'aws-cognito',
           'provider' =&gt; 'users',
        ],
  
        'api' =&gt; [
           'driver' =&gt; 'passport', //'token',
           'provider' =&gt; 'users',
        ],
     ],
  </code></pre>
  
  <p>Then I modified the AppServiceProvider. This is my AppServiceProvider.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\Providers;
  
  use Illuminate\Support\ServiceProvider;
  use Validator;
  use Schema;
  use Laravel\Passport\Passport;
  
  class AppServiceProvider extends ServiceProvider
  {
      protected $policies = [
          'App\Model' =&gt; 'App\Policies\ModelPolicy',
      ];
  
      /**
       * Bootstrap any application services.
       *
       * @return void
       */
      public function boot()
      {
          $this-&gt;registerPolicies();
  
          Passport::routes();
  
      }
  
      /**
       * Register any application services.
       *
       * @return void
       */
      public function register()
      {
          require_once __DIR__ . '/../Helpers/CommonHelper.php';
      }
  }
  </code></pre>
  
  <p>This line is giving me the error</p>
  
  <pre><code>$this-&gt;registerPolicies();
  </code></pre>
  
  <p>Saying method not found. If I commented out that line the application was running. But I should not comment out that line because now I want to protect my API.</p>
  
  <p>For example, I have an API route in the routes/api.php</p>
  
  <pre><code>Route::get('event/list', 'Api\EventController@getEventList');
  </code></pre>
  
  <p>But I want to protect it with the Passport. Now, I can access that API endpoint directly from the browser What is missing in my code to authenticate the API route with Passport?</p>