Laravel:函数Illuminate \ Support \ Manager :: createDriver()的参数太少 [英] Laravel: Too few arguments to function Illuminate\Support\Manager::createDriver()
问题描述
我尝试使用mailtrap和Laravel 5.4测试电子邮件.我收到此错误:
I try to test emails with mailtrap and Laravel 5.4. I get this error:
类型错误:函数参数太少 Illuminate \ Support \ Manager :: createDriver(),传入0 C:\ Users *** \ Documents \ www \ *** \ backend \ vendor \ laravel \ framework \ src \ Illuminate \ Support \ Manager.php在第88行,期望值恰好为1
Type error: Too few arguments to function Illuminate\Support\Manager::createDriver(), 0 passed in C:\Users***\Documents\www\***\backend\vendor\laravel\framework\src\Illuminate\Support\Manager.php on line 88 and exactly 1 expected
我已经尝试过config:cache
,config:clear
等.
这是我回声env('MAIL_DRIVER')
smtp
smtp
这是我的.env文件
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=*********
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=null
这是我的邮件功能:
Mail::send('email.verify', compact('validation_code'), function($message) {
$message->to(Input::get('email'), Input::get('username'))
->subject('Verify your email address');
});
有什么想法吗?
非常感谢:)
推荐答案
我相信,如果您没有在.env文件中设置APP_KEY,则会发生这种情况,因此,如果您没有.APP文件,请运行php artisan key:generate
.
I believe this happens if you do not have the APP_KEY set in a .env file, so run php artisan key:generate
if you do not have one.
这篇关于Laravel:函数Illuminate \ Support \ Manager :: createDriver()的参数太少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!