src/Carbon/Traits/Date.php
protected function resolveCarbon($date = null)
    {
        if (!$date) {
            return $this->nowWithSameTz();
        }

        if (is_string($date)) {
            return static::parse($date, $this->getTimezone());
        }

        static::expectDateTime($date, ['null', 'string']);

        return $date instanceof self ? $date : static::instance($date);
    }
protected function resolveCarbon($date = null)
    {
        if (!$date) {
            return $this->nowWithSameTz();
        }

        if (is_string($date)) {
            return static::parse($date, $this->getTimezone());
        }

        static::expectDateTime($date, ['null', 'string']);

        return $date instanceof self ? $date : static::instance($date);
    }
protected function resolveCarbon ( $ date = null ) { if ( ! $ date ) { return $ this -> nowWithSameTz ( ) ; } if ( is_string ( $ date ) ) { return static :: parse ( $ date , $ this -> getTimezone ( ) ) ; } static :: expectDateTime ( $ date , [ 'null' , 'string' ] ) ; return $ date instanceof self ? $ date : static :: instance ( $ date ) ; }
Return the Carbon instance passed through, a now instance in the same timezone
if null given or parse the input if string given.

@param \Carbon\Carbon|\DateTimeInterface|string|null $date

@return static|CarbonInterface
Return the Carbon instance passed through a now instance in the same timezone if null given or parse the input if string given .