File tree Expand file tree Collapse file tree
user_guide_src/source/libraries Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -425,21 +425,21 @@ replaced by the **value** of the matched incoming field. An example should clari
425425
426426 $validation->setRules([
427427 'email' => 'required|valid_email|is_unique[users.email,id,{id}]'
428- ];
428+ ]) ;
429429
430430In this set of rules, it states that the email address should be unique in the database, except for the row
431431that has an id matching the placeholder's value. Assuming that the form POST data had the following::
432432
433433 $_POST = [
434434 'id' => 4,
435435 'email' => 'foo@example.com'
436- ]
436+ ];
437437
438438then the ``{id} `` placeholder would be replaced with the number **4 **, giving this revised rule::
439439
440440 $validation->setRules([
441441 'email' => 'required|valid_email|is_unique[users.email,id,4]'
442- ];
442+ ]) ;
443443
444444So it will ignore the row in the database that has ``id=4 `` when it verifies the email is unique.
445445
You can’t perform that action at this time.
0 commit comments