Don't trigger a recursive nesting call

This commit is contained in:
Dane Everitt 2020-04-04 11:37:10 -07:00
parent 9991989f89
commit 5f42325284
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 1 additions and 21 deletions

View File

@ -171,6 +171,6 @@ abstract class Model extends IlluminateModel
return parent::asDateTime($value);
}
return $this->asImmutableDateTime($value);
return parent::asDateTime($value)->toImmutable();
}
}

View File

@ -1,20 +0,0 @@
<?php
namespace Pterodactyl\Models\Traits;
/**
* @mixin \Illuminate\Database\Eloquent\Model
*/
trait WithImmutableDates
{
/**
* Converts the mutable Carbon instance into an immutable Carbon instance.
*
* @param mixed $value
* @return \Carbon\CarbonImmutable
*/
protected function asImmutableDateTime($value)
{
return $this->asDateTime($value)->toImmutable();
}
}