Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Passport Install Class Not Found

Tags:

I'm trying to configure my Laravel app to use Passport and have gotten stuck at loading the class in my AppServiceProvider.php. Here is what I've done...

<?php // AuthServiceProvider.php

namespace S1\Providers;

use Laravel\Passport\PassportServiceProvider;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as 
ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
...
    public function boot()
    {
        $this->registerPolicies();
        Passport::routes();
        Passport::tokensCan([
            'client' => 'this is a api client test'
        ]);
    }
}

.

<?php .  // auth.php
 ...
return [

    'guards' => [
        'web' => [
             'driver' => 'passport',
            'provider' => 'users',
        ],
], ...

.

<?php // app.php

'providers' => [
...
Laravel\Passport\PassportServiceProvider::class,
....

.

<?php  // AppServiceProvider.php

namespace S1\Providers;

use Illuminate\Support\ServiceProvider;
use S1\Providers\AppServiceProvider;
use Laravel\Passport\PassportServiceProvider;

class AppServiceProvider extends ServiceProvider
{

    public function register()
    {
        // Enable Laravel Migrations Generator for development only
        if ($this->app->environment() !== 'production') {
            $this->app->register(\Way\Generators\GeneratorsServiceProvider::class);
            $this->app->register(\Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class);
        }
    }
}

The result of this is getting the following error:

  [Symfony\Component\Debug\Exception\FatalThrowableError]  
  Class 'S1\Providers\Passport' not found   

I did have this working but had to rebuid and now I can't get past this error. Something is going on with my namespaces but I can't figure out what.