Illuminate \ Support \ Manager :: createDriver(),在第87行的C:\ xampp \ htdocs \ api \ vendor \ illuminate \ support \ Manager.php中调用并定义

时间:2017-06-13 06:02:45

标签: php laravel lumen

UserContorller.php

public function mail(Request $request)
    {

        Mail::send('Email.test', ["customer" => "John Doe"], function ($message) {
            $message->to('abc@gmail.com', 'example_name')->subject('Welcome!');
        });

    }

web.php

$app->get('mail','UserController@mail');

配置/ mail.php

<?php

return [
    'driver' => "smtp",
    'host' => env('MAIL_HOST=smtp.gmail.com'), // 根据你的邮件服务提供商来填
    'port' => "465", // 同上
    'encryption' => "ssl", // 同上 一般是tls或ssl
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS'),
        'name' => env('MAIL_FROM_NAME'),
    ],
];

error in ErrorException in Manager.php line 77:

缺少Illuminate\Support\Manager::createDriver()的参数1,在第87行的C:\xampp\htdocs\api\vendor\illuminate\support\Manager.php中调用并在流明api中定义。

1 个答案:

答案 0 :(得分:0)

如果.env文件正确,我建议删除composer.lock文件并删除vendor目录并再次运行composer install。也许没有安装完整的包。