misc_pterodactyl-panel/app/Models/Traits/WithImmutableDates.php
2020-04-03 23:22:35 -07:00

20 lines
416 B
PHP

<?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();
}
}