Что я хочу заархивировать: Я хотел бы создать билет Zammad с помощью Zammad-api, но также проанализировать уценку.
Для этого я создал пользовательский канал для отправки уведомления в службу поддержки Zammad с помощью API Zammad.
Это конкретный класс:
<?php
namespace AppChannels;
use IlluminateMailMailable;
class ZammadMessage extends Mailable
{
/**
* The issuer of the ticket.
*
* @var string
*/
public $from;
/**
* The text content of the message.
*
* @var string
*/
private $content;
public function __construct($from, $content = '')
{
$this->from = $from;
$this->content = $content;
}
public static function create($from = '', $content = '')
{
return new static($from, $content);
}
/**
* Set the text content of the message.
*
* @param $content
*
* @return $this
*/
public function content($content)
{
$this->content = $content;
return $this;
}
public function asMarkdown()
{
$this->build();
$this->body = $this->buildView();
return $this;
}
public function build()
{
return $this->from($this->from)
->markdown('emails.contact.submitted', ['data' => $this->content]);
}
/**
* Set the issuer of the ticket.
*
* @param $address
* @param string $name
*
* @return $this
*/
public function from($address, $name = 'null'): static
{
$this->from = $address;
return $this;
}
}
Использование этого класса моим классом уведомлений
public function toTicket($notifiable)
{
$address = $notifiable instanceof AnonymousNotifiable
? collect($notifiable->routeNotificationFor('zammad'))->first()
: $notifiable->email;
return ZammadMessage::create()
->from($address)
->content($this->content)
->asMarkdown();
}
Я получаю эту ошибку:
PHP устарел: передача среды $в конструктор «League/CommonMark/CommonMarkConverter» устарела в версии 1.6 и не будет поддерживаться в версии 2.0; вместо этого используйте MarkdownConverter. Видишь https://commonmark.thephpleague.com/2.0/upgrading/consumers/#commonmarkconverter-and-githubflavoredmarkdownconverter-constructors для получения более подробной информации. в /var/www/html/vendor/league/commonmark/src/CommonMarkConverter.php на линии 43