s-ichikawa/laravel-sendgrid-driver

Laravel 7.0 Support - Fix

kfirba opened this issue · 2 comments

Hey!

Laravel 7.0 has changed the mail.driver config to be to mail.default. The SendGrid trait has a sengdrid method that adds the data sendgrid needs IF the mail driver is sendgrid. The issue is that the method that determines the mail driver is:

    private function mailDriver()
    {
        return function_exists('config') ? config('mail.driver') : env('MAIL_DRIVER');
    }

The method should be changed to look at the mail.default config option rather than the mail.driver. It can optionally fallback to the mail.driver configuration option as it is still supported:

    private function mailDriver()
    {
        return function_exists('config') ? config('mail.default', config('mail.driver')) : env('MAIL_MAILER', env('MAIL_DRIVER'));
    }

Thank you so much.
Fixed and released 3.0.1.

its broken for laravel 6 now