【问题标题】:Getting an error when starting php artisan serve启动 php artisan serve 时出错
【发布时间】:2018-01-18 18:10:31
【问题描述】:

我在启动我的 laravel 服务器时收到以下错误。

[Symfony\Component\Debug\Exception\FatalThrowableError]   
Parse error: syntax error, unexpected '=', expecting ']'

我正在尝试创建一个与 mailchimp api 集成的网络应用程序。我正在使用以下软件包。 Manage Newsletters.

现在我已经创建了 laravel-newsletter.php 并根据以下帖子插入了 api 密钥和列表 ID connecting laravel to mailchimp

下面是我如何列出 api key 和 list id。

<?php

return [

    /*
     * The api key of a MailChimp account. You can find yours here:
     * https://us10.admin.mailchimp.com/account/api-key-popup/
     */
    // 'apiKey' => env('MAILCHIMP_APIKEY'),
    'MAILCHIMP_APIKEY'='API 1234567891011121314',

    /*
     * When not specifying a listname in the various methods, use the list with this name
     */
    'defaultListName' => 'subscribers',

    /*
     * Here you can define properties of the lists you want to
     * send campaigns.
     */
    'lists' => [

        /*
         * This key is used to identify this list. It can be used
         * in the various methods provided by this package.
         *
         * You can set it to any string you want and you can add
         * as many lists as you want.
         */
        'subscribers' => [

            /*
             * A mail chimp list id. Check the mailchimp docs if you don't know
             * how to get this value:
             * http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id
             */
            // 'id' => env('MAILCHIMP_LIST_ID'),
            'id'='123456789',
        ],
    ],

    /*
     * If you're having trouble with https connections, set this to false.
     */
    'ssl' => true,
  ];

【问题讨论】:

  • 'MAILCHIMP_APIKEY'='API 1234567891011121314', 缺少&gt;。与'id'='123456789', 相同。

标签: php laravel-5.4 mailchimp-api-v3.0


【解决方案1】:

这只是一个错字,在

'MAILCHIMP_APIKEY'='API 1234567891011121314',

应该是

'MAILCHIMP_APIKEY'=>'API 1234567891011121314',

'id'=&gt;'123456789',

【讨论】:

  • 列表id也一样吗?
  • @AltBrian All 数组中的键/值对必须是:"key" =&gt; "value",
  • @AltBrian,如果这解决了您的问题,您可以接受作为答案
  • 几分钟前它不会让我。现在已经完成了。
  • 我现在收到(1/1) Exception Invalid MailChimp API key `` supplied.
猜你喜欢
  • 2016-03-09
  • 2016-10-01
  • 1970-01-01
  • 2020-05-29
  • 2021-07-02
  • 2017-12-10
  • 2021-03-31
  • 2021-04-09
  • 1970-01-01
相关资源
最近更新 更多