Replace deprecated method.

This commit is contained in:
James Cole
2022-03-27 20:24:13 +02:00
parent 8ee4c2ea11
commit cbf14f541c
39 changed files with 140 additions and 123 deletions

View File

@@ -57,9 +57,14 @@ class NewIPAddressWarningMail extends Mailable
public function build(): self
{
// time
$this->time = now()->formatLocalized((string)trans('config.date_time'));
$this->time = now(config('app.timezone'))->isoFormat((string)trans('config.date_time_js'));
$this->host = '';
$hostName = gethostbyaddr($this->ipAddress);
try {
$hostName = gethostbyaddr($this->ipAddress);
} catch(\Exception $e) {
$hostName = $this->ipAddress;
}
if ($hostName !== $this->ipAddress) {
$this->host = $hostName;
}