<commit_before><?php
namespace Sichikawa\LaravelSendgridDriver;

use Illuminate\Mail\Mailable;
use Swift_Message;

trait SendGrid
{

    /**
     * @param null|array $params
     * @return $this
     */
    public function sendgrid($params)
    {
        if ($this instanceof Mailable && env('MAIL_DRIVER') == "sendgrid") {
            $this->withSwiftMessage(function (Swift_Message $message) use ($params) {
                $message->embed(\Swift_Image::newInstance($params, 'sendgrid/x-smtpapi'));
            });
        }
        return $this;
    }
}<commit_msg>Update SendGrid.php to work with Cached Config<commit_after><?php
namespace Sichikawa\LaravelSendgridDriver;

use Illuminate\Mail\Mailable;
use Swift_Message;

trait SendGrid
{

    /**
     * @param null|array $params
     * @return $this
     */
    public function sendgrid($params)
    {
        if ($this instanceof Mailable && config('mail.driver') == "sendgrid") {
            $this->withSwiftMessage(function (Swift_Message $message) use ($params) {
                $message->embed(\Swift_Image::newInstance($params, 'sendgrid/x-smtpapi'));
            });
        }
        return $this;
    }
}
{'fraction_non_alphanumeric': 0.1348122866894198, 'fraction_numerical': 0.0, 'mean_word_length': 2.723809523809524, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3693640', 'n_tokens_mistral': 360, 'n_tokens_neox': 349, 'n_words': 70}