Undefined variable - laravel emailing
<p>I'm trying to send an email using laravel. This worked for serveral functions but with this one I'm getting a weird error.</p>

<p>here's the code I'm using</p>

<pre><code>    $offerte = DB::table('offertes')
        -&gt;select('*')
        -&gt;where('id', '=', $offerte_id)
        -&gt;get();

    Mail::send('emails.offerte_reactie', ['offerte' =&gt; $offerte, 'user' =&gt; $user, 'message_text' =&gt; $message_text], function ($message) use ($user)
    {
        $message-&gt;from($user-&gt;email, 'Foodtruckbestellen.be');
        $message-&gt;to($offerte-&gt;email);
        $message-&gt;subject('Reactie offerte Foodtruckbestellen.be');
    });
</code></pre>

<p>However when I want to send the mail I get the error</p>

<blockquote>
  <p>Undefined variable: offerte</p>
</blockquote>

<p>The line <strong>$message->to($offerte->email);</strong> is indeed underlined in red in PHPSTORM and I don't use the variable in the email. so I know for sure that's where my error is I just can't find a fix for it.</p>