Laravel Passport错误 - RequestException.php第107行中的ServerException

时间:2016-09-25 18:18:48

标签: laravel laravel-5 laravel-5.3 laravel-passport

请帮忙。

我按照教程 Laravel 5.3中的新内容:Laravel Passport https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13)一步一步地发现了这个错误:

RequestException.php第107行中的ServerException: 服务器错误:500 Internal Server Error导致UIGestureRecognizer响应: SQLSTATE [42S02]:未找到基表或视图:1146表' consumer.oauth_clients'不存在(SQL:select * from`oa(truncated ...)

consumer.dev

use Illuminate\Http\Request;

Route::get('/', function () {

    $query = http_build_query([
        'client_id'     => 4,
        'redirect_uri'  => 'http://consumer.dev/callback',
        'response_type' => 'code',
        'scope'         => '',
    ]);
    return redirect('http://latest.dev/oauth/authorize?'.$query);
});

Route::get('/callback', function(Request $request) {
    $http = new GuzzleHttp\Client;

    $response = $http->post('http://latest.dev/oauth/token', [
        'form_params'   => [
            'grant_type'        => 'authorization_code',
            'client_id'         => 4,
            'client_secret'     => 'a8OifFPH38rMi1I6vjmV3O8XD55hAk2FG4f95j9W',
            'redirect_uri'      => 'http://consumer.dev/callback',
            'code'              => $request->code,
        ],
    ]);
    return json_decode((string) $response->getBody(), true);
});

1 个答案:

答案 0 :(得分:0)

运行以下命令

php artisan serve

并将网址链接替换为artisan serve命令创建的新网址 然后再试一次 - 然后就可以了。