$attributes */ public function get(Model $model, string $key, mixed $value, array $attributes): ?Carbon { return $value ? Carbon::create($value) : NULL; } /** * Prepare the given value for storage. * * @param array $attributes */ public function set(Model $model, string $key, mixed $value, array $attributes): string|null { return ($value instanceof Carbon ? $value : $this->get($model,$key,$value,$attributes))?->format('Y-m-d H:i:s'); } }