Don't trigger a recursive nesting call
This commit is contained in:
parent
9991989f89
commit
5f42325284
2 changed files with 1 additions and 21 deletions
|
@ -171,6 +171,6 @@ abstract class Model extends IlluminateModel
|
||||||
return parent::asDateTime($value);
|
return parent::asDateTime($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->asImmutableDateTime($value);
|
return parent::asDateTime($value)->toImmutable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue