Mail validation errors is now an object, and must be tested with ->count()

This commit is contained in:
Deon George 2024-05-21 22:10:52 +10:00
parent 17e3c69f07
commit 18f5354d0c
3 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ class PacketProcess implements ShouldQueue
// Check the packet is to our address, if not we'll reject it.
if (! our_address($this->do)->contains($pkt->tftn)) {
Log::error(sprintf('%s:! Packet [%s] is not to our address? [%s]',self::LOGKEY,$this->filename,$pkt->tftn));
Log::error(sprintf('%s:! Packet [%s] is not to our address? [%s]',self::LOGKEY,$this->filename,$pkt->tftn->ftn));
// @todo Notification::route('netmail',$pkt->fftn)->notify(new UnexpectedPacketToUs($this->filename));
break;

View File

@ -92,7 +92,7 @@ final class Echomail extends Model implements Packet
parent::boot();
static::creating(function($model) {
if (! is_null($model->errors))
if ($model->errors->count())
throw new \Exception('Cannot save, validation errors exist');
});

View File

@ -86,7 +86,7 @@ final class Netmail extends Model implements Packet
parent::boot();
static::creating(function($model) {
if (! is_null($model->errors))
if ($model->errors->count())
throw new \Exception('Cannot save, validation errors exist');
});