0

我开发了一个 laravel 应用程序,我想自动将剩余的电子邮件发送给用户。

我像本文一样创建了命令。但我得到这个错误:

  [Illuminate\Contracts\Container\BindingResolutionException]
  Unresolvable dependency resolving [Parameter #0 [ <required> $config ]] in
  class RollbarNotifier

这是我的代码:

.env

MAIL_DRIVER=smtp
MAIL_HOST=example.com
MAIL_PORT=465
MAIL_USERNAME=noreply@example.com
MAIL_PASSWORD=PAssWord
MAIL_ENCRYPTION=SSL

MAIL_FROM_ADDRESS=noreply@example.com
MAIL_FROM_NAME="FROM FROM"

ROLLBAR_TOKEN=<my_token>

配置/邮件.php

<?php
return [
    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'example.com'),
    'port' => env('MAIL_PORT', 465),

    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'noreply@example.com'),
        'name' => env('MAIL_FROM_NAME', 'FROM FROM'),
    ],

    'encryption' => env('MAIL_ENCRYPTION', 'SSL'),
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'sendmail' => '/usr/sbin/sendmail -bs',
    'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],    
];
4

1 回答 1

0

看起来您的依赖注入不起作用。它缺少配置文件。

我不确定您使用的是哪个软件包。但是当我查看https://github.com/jenssegers/laravel-rollbar的安装手册时,我发现您还必须在以下位置添加一些配置services.php

'rollbar' => [
    'access_token' => env('ROLLBAR_TOKEN'),
    'level' => env('ROLLBAR_LEVEL'),
],
于 2018-10-01T08:43:47.283 回答