src/Carbon/Traits/Boundaries.php
public function startOf($unit, ...$params)
    {
        $ucfUnit = ucfirst(static::singularUnit($unit));
        $method = "startOf$ucfUnit";
        if (!method_exists($this, $method)) {
            throw new InvalidArgumentException("Unknown unit '$unit'");
        }

        return $this->$method(...$params);
    }
public function startOf($unit, ...$params)
    {
        $ucfUnit = ucfirst(static::singularUnit($unit));
        $method = "startOf$ucfUnit";
        if (!method_exists($this, $method)) {
            throw new InvalidArgumentException("Unknown unit '$unit'");
        }

        return $this->$method(...$params);
    }
public function startOf ( $ unit , ... $ params ) { $ ucfUnit = ucfirst ( static :: singularUnit ( $ unit ) ) ; $ method = "startOf$ucfUnit" ; if ( ! method_exists ( $ this , $ method ) ) { throw new InvalidArgumentException ( "Unknown unit '$unit'" ) ; } return $ this -> $ method ( ... $ params ) ; }
Modify to start of current given unit.

@example
```
echo Carbon::parse('2018-07-25 12:45:16.334455')
->startOf('month')
->endOf('week', Carbon::FRIDAY);
```

@param string            $unit
@param array<int, mixed> $params

@return static|CarbonInterface
Modify to start of current given unit .