You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/custom-config-parameters.md
+15-5
Original file line number
Diff line number
Diff line change
@@ -11,23 +11,26 @@ These parameters are related to the `NoUnnecessaryCollectionCall` rule. You can
11
11
By default, the default Laravel database migration path (`database/migrations`) is used to scan migration files to understand the table structure and model properties. If you have database migrations in other place than the default, you can use this config parameter to tell Larastan where the database migrations are stored.
12
12
13
13
You can give absolute paths, or paths relative to the PHPStan config file.
14
+
Paths with wildcards are also supported (passed to `glob` function).
14
15
15
16
#### Example
17
+
16
18
```neon
17
19
parameters:
18
20
databaseMigrationsPath:
19
-
- app/Domain/DomainA/migrations
20
-
- app/Domain/DomainB/migrations
21
+
- app/Domain/*/migrations
21
22
```
22
23
23
24
**Note:** If your migrations are using `if` statements to conditionally alter database structure (ex: create table only if it's not there, add column only if table exists and column does not etc...) Larastan will assume those if statements evaluate to true and will consider everything from the `if` body.
24
25
25
26
## `disableMigrationScan`
27
+
26
28
**default**: `false`
27
29
28
30
You can disable use this config to disable migration scanning.
29
31
30
32
#### Example
33
+
31
34
```neon
32
35
parameters:
33
36
disableMigrationScan: true
@@ -37,12 +40,14 @@ parameters:
37
40
38
41
By default, Larastan will check `database/schema` directory to find schema dumps. If you have them in other locations or if you have multiple folders, you can use this config option to add them.
39
42
43
+
Paths with wildcards are also supported (passed to `glob` function).
44
+
40
45
#### Example
46
+
41
47
```neon
42
48
parameters:
43
49
squashedMigrationsPath:
44
-
- app/Domain/DomainA/schema
45
-
- app/Domain/DomainB/schema
50
+
- app/Domain/*/schema
46
51
```
47
52
48
53
#### PostgreSQL
@@ -51,21 +56,25 @@ The package used to parse the schema dumps, [phpmyadmin/sql-parser](https://gith
51
56
It can read (or rather, try to read) PostgreSQL dumps provided they are in the *plain text (and not the 'custom') format*, but the mileage may vary as problems have been noted with timestamp columns and lengthy parse time on more complicated dumps.
52
57
53
58
The viable options for PostgreSQL at the moment are:
54
-
1. Use the [laravel-ide-helper](https://github.com/barryvdh/laravel-ide-helper) package to write PHPDocs directly to the Models.
59
+
60
+
1. Use the [laravel-ide-helper](https://github.com/barryvdh/laravel-ide-helper) package to write PHPDocs directly to the Models.
55
61
2. Use the [laravel-migrations-generator](https://github.com/kitloong/laravel-migrations-generator) to generate migration files (or a singular squashed migration file) for Larastan to scan with the `databaseMigrationsPath` setting.
56
62
57
63
## `disableSchemaScan`
64
+
58
65
**default**: `false`
59
66
60
67
You can disable use this config to disable schema scanning.
61
68
62
69
#### Example
70
+
63
71
```neon
64
72
parameters:
65
73
disableSchemaScan: true
66
74
```
67
75
68
76
## `checkModelProperties`
77
+
69
78
**default**: `false`
70
79
71
80
This config parameter enables the checks for model properties that are passed to methods. You can read the details [here](rules.md#modelpropertyrule).
@@ -78,6 +87,7 @@ parameters:
78
87
```
79
88
80
89
## `checkModelAppends`
90
+
81
91
**default**: `false`
82
92
83
93
This config parameter enables the checks the model's $appends property for computed properties. You can read the details [here](rules.md#modelappendsrule).
0 commit comments