Не могу понять что происходит.
Вводные данные:
Класс для отправки почты:
spoilerclass SendEmail implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $addressee;
protected $subject;
protected $text;
protected $message;
public function __construct(array $addressee, string $subject, string $text, $message = false)
{
$this->addressee = $addressee;
$this->subject = $subject;
$this->text = $text;
$this->message = $message;
}
public function handle()
{
foreach ($this->addressee as $recipient) Mail::to($recipient)->send(new Letter(
$this->subject,
$this->text,
$recipient
));
if ($this->message) {
$message = Message::find($this->message);
$message->status = 1;
$message->save();
}
}
}
Текст ошибки:
spoilerproduction.ERROR: Trying to get property 'addressee' of non-object {"exception":"[object] (ErrorException(code: 0): Trying to get property 'addressee' of non-object at /var/www/app/Jobs/SendEmail.php:44) [stacktrace] #0 /var/www/app/Jobs/SendEmail.php(44): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError() #1 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\SendEmail->handle() #2 /var/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #3 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure() #4 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod() #5 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(611): Illuminate\\Container\\BoundMethod::call() #6 /var/www/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call() #7 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}() #8 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #9 /var/www/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then() #10 /var/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(118): Illuminate\\Bus\\Dispatcher->dispatchNow() #11 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}() #12 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #13 /var/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(120): Illuminate\\Pipeline\\Pipeline->then() #14 /var/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware() #15 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call() #16 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(410): Illuminate\\Queue\\Jobs\\Job->fire() #17 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(360): Illuminate\\Queue\\Worker->process() #18 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(158): Illuminate\\Queue\\Worker->runJob() #19 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(117): Illuminate\\Queue\\Worker->daemon() #20 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\\Queue\\Console\\WorkCommand->runWorker() #21 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle() #22 /var/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #23 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure() #24 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod() #25 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(611): Illuminate\\Container\\BoundMethod::call() #26 /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call() #27 /var/www/vendor/symfony/console/Command/Command.php(256): Illuminate\\Console\\Command->execute() #28 /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run() #29 /var/www/vendor/symfony/console/Application.php(971): Illuminate\\Console\\Command->run() #30 /var/www/vendor/symfony/console/Application.php(290): Symfony\\Component\\Console\\Application->doRunCommand() #31 /var/www/vendor/symfony/console/Application.php(166): Symfony\\Component\\Console\\Application->doRun() #32 /var/www/vendor/laravel/framework/src/Illuminate/Console/Application.php(92): Symfony\\Component\\Console\\Application->run() #33 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run() #34 /var/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle() #35 {main} "}
На тестовом сервере всё работает отлично.
Самое странное то, что стоит мне переименовать все слова
addressee на любые другие - ошибка не изменится, то есть будет ссылаться всё равно на
addressee.
Всевозможные кеши чистил, не помогает.