So I followed Taylors introduction to Passport on Laracasts and when I attempted to POST to the OAuth server /oauth/token
URL with the newly acquired code I get a 'homestead.oauth_clients' doesn't exist' error.
In other words it's using the wrong database connection! I set this up using SQLite and even hard coded 'default' => 'sqlite'
in config/database.php. (.env is also set correctly)
[2016-09-10 03:17:10] local.ERROR: exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.oauth_clients' doesn't exist' in D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Connection.php:333
Stack trace:
#0 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Connection.php(333): PDO->prepare('select * from `...')
#1 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Connection.php(754): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\MySqlConnection), 'select * from `...', Array)
#2 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Connection.php(717): Illuminate\Database\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#3 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Connection.php(351): Illuminate\Database\Connection->run('select * from `...', Array, Object(Closure))
#4 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php(1645): Illuminate\Database\Connection->select('select * from `...', Array, true)
#5 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php(1631): Illuminate\Database\Query\Builder->runSelect()
#6 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php(613): Illuminate\Database\Query\Builder->get(Array)
#7 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php(318): Illuminate\Database\Eloquent\Builder->getModels(Array)
#8 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php(288): Illuminate\Database\Eloquent\Builder->get(Array)
#9 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php(168): Illuminate\Database\Eloquent\Builder->first(Array)
#10 [internal function]: Illuminate\Database\Eloquent\Builder->find('3')
#11 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(3515): call_user_func_array(Array, Array)
#12 [internal function]: Illuminate\Database\Eloquent\Model->__call('find', Array)
#13 [internal function]: Laravel\Passport\Client->find('3')
#14 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(3529): call_user_func_array(Array, Array)
#15 D:\Dev\Passport\vendor\laravel\passport\src\ClientRepository.php(15): Illuminate\Database\Eloquent\Model::__callStatic('find', Array)
#16 D:\Dev\Passport\vendor\laravel\passport\src\ClientRepository.php(15): Laravel\Passport\Client::find('3')
#17 D:\Dev\Passport\vendor\laravel\passport\src\ClientRepository.php(26): Laravel\Passport\ClientRepository->find('3')
#18 D:\Dev\Passport\vendor\laravel\passport\src\Bridge\ClientRepository.php(37): Laravel\Passport\ClientRepository->findActive('3')
#19 D:\Dev\Passport\vendor\league\oauth2-server\src\Grant\AbstractGrant.php(160): Laravel\Passport\Bridge\ClientRepository->getClientEntity('3', 'authorization_c...', 'yExYq8aAYCbbtB6...', true)
#20 D:\Dev\Passport\vendor\league\oauth2-server\src\Grant\AuthCodeGrant.php(74): League\OAuth2\Server\Grant\AbstractGrant->validateClient(Object(Zend\Diactoros\ServerRequest))
#21 D:\Dev\Passport\vendor\league\oauth2-server\src\AuthorizationServer.php(180): League\OAuth2\Server\Grant\AuthCodeGrant->respondToAccessTokenRequest(Object(Zend\Diactoros\ServerRequest), Object(League\OAuth2\Server\ResponseTypes\BearerTokenResponse), Object(DateInterval))
#22 D:\Dev\Passport\vendor\laravel\passport\src\Http\Controllers\AccessTokenController.php(63): League\OAuth2\Server\AuthorizationServer->respondToAccessTokenRequest(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response))
#23 D:\Dev\Passport\vendor\laravel\passport\src\Http\Controllers\HandlesOAuthErrors.php(25): Laravel\Passport\Http\Controllers\AccessTokenController->Laravel\Passport\Http\Controllers\{closure}()
#24 D:\Dev\Passport\vendor\laravel\passport\src\Http\Controllers\AccessTokenController.php(64): Laravel\Passport\Http\Controllers\AccessTokenController->withErrorHandling(Object(Closure))
#25 [internal function]: Laravel\Passport\Http\Controllers\AccessTokenController->issueToken(Object(Zend\Diactoros\ServerRequest))
#26 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(47): call_user_func_array(Array, Array)
#27 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Route.php(190): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Laravel\Passport\Http\Controllers\AccessTokenController), 'issueToken')
#28 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Route.php(144): Illuminate\Routing\Route->runController()
#29 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(642): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#30 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#31 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#32 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(644): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#33 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(618): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#34 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(596): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#35 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(267): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#36 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#37 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#38 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(137): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#41 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#42 D:\Dev\Passport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#43 D:\Dev\Passport\public\index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#44 {main}