Add kludge to Test responses
This commit is contained in:
@@ -21,6 +21,8 @@ final class Echomail extends Model implements Packet
|
||||
|
||||
protected $collection = FALSE;
|
||||
|
||||
protected $casts = [ 'kludges' => 'json' ];
|
||||
|
||||
private const cast_utf8 = [
|
||||
'subject',
|
||||
'msg',
|
||||
@@ -84,6 +86,11 @@ final class Echomail extends Model implements Packet
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
public function getKludgesAttribute(string $value): Collection
|
||||
{
|
||||
return collect($this->castAttribute('kludges',$value));
|
||||
}
|
||||
|
||||
public function getPathAttribute(?array $value): Collection
|
||||
{
|
||||
if (is_null($value))
|
||||
@@ -136,6 +143,9 @@ final class Echomail extends Model implements Packet
|
||||
$o->echoarea = $this->echoarea->name;
|
||||
$o->flags = $this->flags;
|
||||
|
||||
if ($this->kludges)
|
||||
$o->kludge = $this->kludges;
|
||||
|
||||
$o->kludge->put('mid',$this->id);
|
||||
|
||||
$o->msgid = $this->msgid;
|
||||
|
Reference in New Issue
Block a user