title: Getting error routeNotificationFor() on laravel notifications
body: <p>I'm trying to send email to members on my app and I get the following error:</p>
  
  <blockquote>
    <p>production.ERROR: Call to undefined method
    Illuminate\Database\Query\Builder::routeNotificationFor()
    {"exception":"[object] (BadMethodCallException(code: 0): Call to
    undefined method
    Illuminate\Database\Query\Builder::routeNotificationFor() at
    /var/www/vhosts/.../laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2483)</p>
  </blockquote>
  
  <p>I have the members model with the <code>Notifiable</code> trait and the weird issue is that on my local machine the emails are delivered... The problem is on production... </p>
  
  <p><strong>Any ideas?</strong></p>
  
  <p>The notifications are fired with: </p>
  
  <pre class="lang-php prettyprint-override"><code>Notification::send($members_to_notify, new CommMessage($communication));
  </code></pre>
  
  <p>And the <code>CommMessage</code>class is:</p>
  
  <p><strong>CommMessage.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>namespace App\Notifications\Communications;
  
  use Illuminate\Bus\Queueable;
  use Illuminate\Notifications\Notification;
  use Illuminate\Contracts\Queue\ShouldQueue;
  use Illuminate\Notifications\Messages\MailMessage;
  use App\Mail\Communications\Message as Mailable;
  
  class CommMessage extends Notification implements ShouldQueue
  {
  
      use Queueable;
  
      private $communication;
  
      /**
       * Create a new notification instance.
       *
       * @return void
       */
      public function __construct($communication)
      {
          $this-&gt;communication = $communication;
  
      }
  
      /**
       * Get the notification's delivery channels.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function via($notifiable)
      {
          return ['mail'];
      }
  
      /**
       * Get the mail representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return Mailable
       */
      public function toMail($notifiable)
      {
          return (new Mailable($this-&gt;communication))-&gt;to($notifiable-&gt;email);
      }
  }
  </code></pre>
  
  <p>The mailable <code>Message</code> class is:</p>
  
  <p><strong>Message.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>namespace App\Mail\Communications;
  
  use Illuminate\Bus\Queueable;
  use Illuminate\Mail\Mailable;
  use Illuminate\Queue\SerializesModels;
  use Illuminate\Contracts\Queue\ShouldQueue;
  
  class Message extends Mailable
  {
      use Queueable, SerializesModels;
  
      /**
       * The appointment instance.
       *
       * @var Appointment
       */
      public $communication;
  
      /**
       * Create a new message instance.
       *
       * @return void
       */
      public function __construct($communication)
      {
          $this-&gt;communication = $communication;
  
      }
  
      /**
       * Build the message.
       *
       * @return $this
       */
      public function build()
      {
          $this-&gt;replyTo($this-&gt;communication-&gt;school-&gt;email)
               -&gt;markdown('emails.communications.message');
  
          $this-&gt;subject($this-&gt;communication-&gt;title);
  
          $this-&gt;withSwiftMessage(function ($message) {
              $message-&gt;getHeaders()
                      -&gt;addTextHeader('X-Mailgun-Variables', json_encode([
                          'model_id' =&gt; $this-&gt;communication-&gt;id,
                          'model' =&gt; get_class($this-&gt;communication),
                          'email_type' =&gt; 11 //Communication message (EmailLogType)
                      ]));
          });
  
      }
  
  }
  </code></pre>