File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 4
4
5
5
/*
6
6
* All models in these directories will be scanned for ER diagram generation.
7
- * The directories will not be scanned recursively, so be sure to add all
8
- * directories that contain your models.
7
+ * By default, the `app` directory will be scanned recursively for models.
9
8
*/
10
9
'directories ' => [
11
- // app_path('models' ),
10
+ app_path (),
12
11
],
13
12
13
+ /*
14
+ * If true, all directories specified will be scanned recursively for models.
15
+ * Set this to false if you prefer to explicitly define each directory that should
16
+ * be scanned for models.
17
+ */
18
+ 'recursive ' => true ,
19
+
14
20
/*
15
21
* The generator will automatically try to look up the model specific columns
16
22
* and add them to the generated output. If you do not wish to use this
92
98
],
93
99
]
94
100
95
- ];
101
+ ];
Original file line number Diff line number Diff line change @@ -82,9 +82,7 @@ protected function getModelsThatShouldBeInspected(): Collection
82
82
{
83
83
$ directories = config ('erd-generator.directories ' );
84
84
85
- $ modelsFromDirectories = empty ($ directories ) ?
86
- $ this ->modelFinder ->getModelsInDirectory (app_path (), true ) :
87
- $ this ->getAllModelsFromEachDirectory ($ directories );
85
+ $ modelsFromDirectories = $ this ->getAllModelsFromEachDirectory ($ directories );
88
86
89
87
return $ modelsFromDirectories ;
90
88
}
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ public function __construct(Filesystem $filesystem)
22
22
$ this ->filesystem = $ filesystem ;
23
23
}
24
24
25
- public function getModelsInDirectory (string $ directory, bool $ recursive = false ): Collection
25
+ public function getModelsInDirectory (string $ directory ): Collection
26
26
{
27
- $ files = $ recursive ?
27
+ $ files = config ( ' erd-generator. recursive' ) ?
28
28
$ this ->filesystem ->allFiles ($ directory ) :
29
29
$ this ->filesystem ->files ($ directory );
30
30
You can’t perform that action at this time.
0 commit comments