Strange. All looks fine to me. Try running composer dump-autoload in the terminal.
Mail queue error
When I try to queue mail (Mail::to($to)->bcc($bcc)->queue(new GenericMail($subject, $content));) I receive this error:
PHP Fatal error: Illuminate\Mail\SendQueuedMailable::handle(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "App\Mail\GenericMail" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /Users/jurejager/Code/api.dewesoft/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php on line 52
But when I send without adding to the queue (Mail::to($to)->bcc($bcc)->send(new GenericMail($subject, $content));), mail is sent.
My mail class:
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class GenericMail extends Mailable
{
public $content;
public $subject;
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @param $subject
* @param $content
*/
public function __construct($subject, $content)
{
$this->subject = $subject;
$this->content = $content;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject($this->subject)->view('mails.generic-template');
}
}
Did anyone had the same problem?
Thanks
Please or to participate in this conversation.