forked from Alex/Pterodactyl-Panel
Don't trigger a recursive nesting call
This commit is contained in:
parent
9991989f89
commit
5f42325284
@ -171,6 +171,6 @@ abstract class Model extends IlluminateModel
|
||||
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 New Issue
Block a user