Skip to content

Commit 252b300

Browse files
(v2.1) simplify config
1 parent 25cd509 commit 252b300

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

config/request-docs.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131

3232
// https://github.com/rakutentech/laravel-request-docs/pull/92
3333
// When rules are put in other method than rules()
34-
'request_methods' => [
35-
'rules',
36-
'onCreate',
37-
'onUpdate',
34+
'rules_methods' => [
35+
'rules'
3836
],
3937

4038
// No need to touch below

src/LaravelRequestDocs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function appendRequestRules(array $controllersInfo): array
214214
//throw $th;
215215
}
216216

217-
foreach (config('request-docs.request_methods') as $requestMethod) {
217+
foreach (config('request-docs.rules_methods') as $requestMethod) {
218218
if ($requestClass && method_exists($requestClass, $requestMethod)) {
219219
try {
220220
$controllersInfo[$index]['rules'] = array_merge($controllersInfo[$index]['rules'], $this->flattenRules($requestClass->$requestMethod()));

0 commit comments

Comments
 (0)