File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 77 //Example
88 // \App\Http\Middleware\NotFoundWhenProduction::class,
99 ],
10- 'docs_path ' => base_path ('docs/request-docs/ ' )
10+ 'docs_path ' => base_path ('docs/request-docs/ ' ),
11+ 'hide_matching ' => [
12+ "#^telescope# " ,
13+ "#^docs# " ,
14+ "#^request-docs# " ,
15+ ]
1116];
Original file line number Diff line number Diff line change 66use ReflectionMethod ;
77use Illuminate \Http \Request ;
88use Illuminate \Foundation \Http \FormRequest ;
9+ use Illuminate \Support \Str ;
910class LaravelRequestDocs
1011{
1112
1213 public function getDocs ()
1314 {
1415 $ docs = [];
16+ $ excludePatterns = config ('request-docs.hide_matching ' ) ?? [];
1517 $ controllersInfo = $ this ->getControllersInfo ();
1618 $ controllersInfo = $ this ->appendRequestRules ($ controllersInfo );
1719 foreach ($ controllersInfo as $ controllerInfo ) {
18- if (!empty ($ controllerInfo ['rules ' ])) {
20+ $ exclude = false ;
21+ foreach ($ excludePatterns as $ regex ) {
22+ $ uri = $ controllerInfo ['uri ' ];
23+ if (preg_match ($ regex , $ uri )) {
24+ $ exclude = true ;
25+ }
26+ }
27+ if (!$ exclude ) {
1928 $ docs [] = $ controllerInfo ;
2029 }
2130 }
You can’t perform that action at this time.
0 commit comments