protected function getValidDateObject($date)
    {
        if (empty($date)) {
            return null;
        }
        if (is_string($date)) {
            return new Carbon($date);
        }

        return $date;
    }
protected function getValidDateObject($date)
    {
        if (empty($date)) {
            return null;
        }
        if (is_string($date)) {
            return new Carbon($date);
        }

        return $date;
    }
protected function getValidDateObject ( $ date ) { if ( empty ( $ date ) ) { return null ; } if ( is_string ( $ date ) ) { return new Carbon ( $ date ) ; } return $ date ; }
Get a valid date property to persist.

@param \DateTime|string|null $date

@return \DateTime|null
Get a valid date property to persist .