{"record":{"id":"f54e5023a9814763","repo":"z-song/laravel-admin","slug":"the-second-paramater-on-must-be-one-of-create","errorCode":null,"errorMessage":"The second paramater `$on` must be one of ['create', 'edit']","messagePattern":"The second paramater `\\$on` must be one of \\['create', 'edit'\\]","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Form.php","lineNumber":1271,"sourceCode":"    public function setTitle($title = ''): self\n    {\n        $this->builder()->setTitle($title);\n\n        return $this;\n    }\n\n    /**\n     * Set a submit confirm.\n     *\n     * @param string $message\n     * @param string $on\n     *\n     * @return $this\n     */\n    public function confirm(string $message, $on = null)\n    {\n        if ($on && !in_array($on, ['create', 'edit'])) {\n            throw new \\InvalidArgumentException(\"The second paramater `\\$on` must be one of ['create', 'edit']\");\n        }\n\n        if ($on == 'create' && !$this->isCreating()) {\n            return;\n        }\n\n        if ($on == 'edit' && !$this->isEditing()) {\n            return;\n        }\n\n        $this->builder()->confirm($message);\n\n        return $this;\n    }\n\n    /**\n     * Add a row in form.\n     *","sourceCodeStart":1253,"sourceCodeEnd":1289,"githubUrl":"https://github.com/z-song/laravel-admin/blob/67c441eb78ecc5437e59775d89770cd9c2cb1e05/src/Form.php#L1253-L1289","documentation":"Error \"The second paramater `$on` must be one of ['create', 'edit']\" thrown in z-song/laravel-admin.","triggerScenarios":"Thrown at src/Form.php:1271 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":"67c441eb78ecc5437e59775d89770cd9c2cb1e05","analyzedAt":"2026-08-21T02:51:03.143Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}