mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 22:03:44 +02:00
Don't trigger a recursive nesting call
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user