Skip to content

Commit 0aeacb5

Browse files
committed
Fixed 'accepted' validation rule, to show as required
1 parent 5ef727e commit 0aeacb5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Mpociot/ApiDoc/ApiDocGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ protected function parseRule($rule, &$attributeData)
137137
$attributeData['required'] = true;
138138
break;
139139
case 'accepted':
140+
$attributeData['required'] = true;
140141
$attributeData['type'] = 'boolean';
141142
break;
142143
case 'after':

tests/ApiDocGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function testCanParseFormRequestRules()
7979

8080

8181
case 'accepted':
82-
$this->assertFalse( $attribute['required'] );
82+
$this->assertTrue( $attribute['required'] );
8383
$this->assertEquals( 'boolean', $attribute['type'] );
8484
$this->assertCount( 0, $attribute['description'] );
8585
break;

0 commit comments

Comments
 (0)