{"record":{"id":"633603c565c7cbb1","repo":"briannesbitt/Carbon","slug":"could-not-modify-with-modify","errorCode":null,"errorMessage":"Could not modify with: {modify}","messagePattern":"Could not modify with: (.+?)","errorType":"exception","errorClass":"Carbon\\Exceptions\\InvalidFormatException","httpStatus":null,"severity":"error","filePath":"src/Carbon/Traits/Modifiers.php","lineNumber":443,"sourceCode":"     * @return static\n     */\n    public function maximum($date = null)\n    {\n        return $this->max($date);\n    }\n\n    /**\n     * Calls \\DateTime::modify if mutable or \\DateTimeImmutable::modify else.\n     *\n     * @see https://php.net/manual/en/datetime.modify.php\n     *\n     * @return static\n     */\n    #[ReturnTypeWillChange]\n    public function modify($modify)\n    {\n        return parent::modify((string) $modify)\n            ?: throw new InvalidFormatException('Could not modify with: '.var_export($modify, true));\n    }\n\n    /**\n     * Similar to native modify() method of DateTime but can handle more grammars.\n     *\n     * @example\n     * ```\n     * echo Carbon::now()->change('next 2pm');\n     * ```\n     *\n     * @link https://php.net/manual/en/datetime.modify.php\n     *\n     * @param string $modifier\n     *\n     * @return static\n     */\n    public function change($modifier)\n    {","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/briannesbitt/Carbon/blob/b13f05955dcfd7da71d60af745fd148cbdb73505/src/Carbon/Traits/Modifiers.php#L425-L461","documentation":"Error \"Could not modify with: {modify}\" thrown in briannesbitt/Carbon.","triggerScenarios":"Thrown at src/Carbon/Traits/Modifiers.php:443 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b13f05955dcfd7da71d60af745fd148cbdb73505","analyzedAt":"2026-08-17T04:40:56.953Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}