Laravel 有效载荷无效。decastro4软件包Gmail API存在问题

Laravel 有效载荷无效。decastro4软件包Gmail API存在问题,laravel,gmail-api,Laravel,Gmail Api,在创建JSON加密文件后,在集成decastro4 Laravel Gmail API时遇到问题 这就是我所做的 路线: Route::get('/oauth/gmail', function (){ return LaravelGmail::redirect(); }); Route::get('/oauth/gmail/callback', function (){ LaravelGmail::makeToken(); return redirect()->t

在创建JSON加密文件后,在集成decastro4 Laravel Gmail API时遇到问题

这就是我所做的

路线:

Route::get('/oauth/gmail', function (){
    return LaravelGmail::redirect();
});

Route::get('/oauth/gmail/callback', function (){
    LaravelGmail::makeToken();
    return redirect()->to('/');
});

Route::get('/oauth/gmail/logout', function (){
    LaravelGmail::logout(); //It returns exception if fails
    return redirect()->to('/');
});
这是文件:

这是Gmail配置文件:

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Gmail Configuration
    |--------------------------------------------------------------------------
    |
    |
    |
    |  Scopes Available:
    |
    |   * all - Read, send, delete, and manage your email
    |   * compose - Manage drafts and send emails
    |   * insert - Insert mail into your mailbox
    |   * labels - Manage mailbox labels
    |   * metadata - View your email message metadata such as labels and headers, but not the email body
    |   * modify - View and modify but not delete your email
    |   * readonly - View your email messages and settings
    |   * send - Send email on your behalf
    |   * settings_basic - Manage your basic mail settings
    |   * settings_sharing - Manage your sensitive mail settings, including who can manage your mail
    |
    |   Leaving the scopes empty fill use readonly
    |
    |  Credentials File Name
    |
    */

    'project_id' => env('GOOGLE_PROJECT_ID'),
    'client_id' => env('GOOGLE_CLIENT_ID'),
    'client_secret' => env('GOOGLE_CLIENT_SECRET'),
    'redirect_url' => env('GOOGLE_REDIRECT_URI', 'http://localhost:8000/test'),

    'state' => null,

    'scopes' => [
        'readonly',
        'modify',
    ],

    /*
    |--------------------------------------------------------------------------
    | Additional Scopes [URL Style]
    |--------------------------------------------------------------------------
    |
    |   'additional_scopes' => [
    |        'https://www.googleapis.com/auth/drive',
    |        'https://www.googleapis.com/auth/documents'
    |   ],
    |
    |
    */

    'additional_scopes' => [

    ],

    'access_type' => 'offline',

    'approval_prompt' => 'force',

    /*
    |--------------------------------------------------------------------------
    | Credentials File Name
    |--------------------------------------------------------------------------
    |
    |   :email to use, clients email on the file
    |
    |
    */

    'credentials_file_name' => env('GOOGLE_CREDENTIALS_NAME', 'gmail-json'),

    /*
    |--------------------------------------------------------------------------
    | Allow Multiple Credentials
    |--------------------------------------------------------------------------
    |
    |   Allow the application to store multiple credential json files.
    |
    |
    */

    'allow_multiple_credentials' => env('GOOGLE_ALLOW_MULTIPLE_CREDENTIALS', true),

    /*
    |--------------------------------------------------------------------------
    | Allow Encryption for json Files
    |--------------------------------------------------------------------------
    |
    |   Use Laravel Encrypt in json Files
    |
    |
    */

    'allow_json_encrypt' => env('GOOGLE_ALLOW_JSON_ENCRYPT', true),
];

刀片:

starting test

@foreach($messages as $message)
    <p>{{$message->getHtmlBody()}}</p>
    <p>{{$message->getSubject()}}</p>
@endforeach
启动测试
@foreach($messages作为$message)
{{$message->getHtmlBody()}

{{$message->getSubject()}

@endforeach
但是“我收到这个错误=>
找不到凭据。

starting test

@foreach($messages as $message)
    <p>{{$message->getHtmlBody()}}</p>
    <p>{{$message->getSubject()}}</p>
@endforeach