5

I try to test emails with mailtrap and Laravel 5.4. I get this error:

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

I already tried to config:cache, config:clearetc.

Here is what php artisan tinkerreturns when I echo env('MAIL_DRIVER')

smtp

Here is my .env file

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io 
MAIL_PORT=2525 
MAIL_USERNAME=*********
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=null

And here is my Mail function:

Mail::send('email.verify', compact('validation_code'), function($message) {
    $message->to(Input::get('email'), Input::get('username'))
        ->subject('Verify your email address');
});

Any ideas ?

Thanks a lot :)

Dees Oomens
  • 4,554
  • 3
  • 29
  • 61
Doddo
  • 51
  • 1
  • 1
  • 3

2 Answers2

2

Here is possible solution

Make sure followings are not empty

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
ErcanE
  • 1,571
  • 3
  • 19
  • 28
1

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.

Carson Evans
  • 1,518
  • 1
  • 13
  • 12