Skip to content

Commit 190e268

Browse files
committed
added ide-helper config
1 parent 75c2c2e commit 190e268

File tree

1 file changed

+281
-0
lines changed

1 file changed

+281
-0
lines changed

config/ide-helper.php

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Filename & Format
8+
|--------------------------------------------------------------------------
9+
|
10+
| The default filename
11+
|
12+
*/
13+
14+
'filename' => '_ide_helper.php',
15+
16+
/*
17+
|--------------------------------------------------------------------------
18+
| Where to write the PhpStorm specific meta file
19+
|--------------------------------------------------------------------------
20+
|
21+
| PhpStorm also supports the directory `.phpstorm.meta.php/` with arbitrary
22+
| files in it, should you need additional files for your project; e.g.
23+
| `.phpstorm.meta.php/laravel_ide_Helper.php'.
24+
|
25+
*/
26+
'meta_filename' => '.phpstorm.meta.php',
27+
28+
/*
29+
|--------------------------------------------------------------------------
30+
| Fluent helpers
31+
|--------------------------------------------------------------------------
32+
|
33+
| Set to true to generate commonly used Fluent methods
34+
|
35+
*/
36+
37+
'include_fluent' => false,
38+
39+
/*
40+
|--------------------------------------------------------------------------
41+
| Factory Builders
42+
|--------------------------------------------------------------------------
43+
|
44+
| Set to true to generate factory generators for better factory()
45+
| method auto-completion.
46+
|
47+
| Deprecated for Laravel 8 or latest.
48+
|
49+
*/
50+
51+
'include_factory_builders' => false,
52+
53+
/*
54+
|--------------------------------------------------------------------------
55+
| Write Model Magic methods
56+
|--------------------------------------------------------------------------
57+
|
58+
| Set to false to disable write magic methods of model
59+
|
60+
*/
61+
62+
'write_model_magic_where' => true,
63+
64+
/*
65+
|--------------------------------------------------------------------------
66+
| Write Model External Eloquent Builder methods
67+
|--------------------------------------------------------------------------
68+
|
69+
| Set to false to disable write external eloquent builder methods
70+
|
71+
*/
72+
73+
'write_model_external_builder_methods' => true,
74+
75+
/*
76+
|--------------------------------------------------------------------------
77+
| Write Model relation count properties
78+
|--------------------------------------------------------------------------
79+
|
80+
| Set to false to disable writing of relation count properties to model DocBlocks.
81+
|
82+
*/
83+
84+
'write_model_relation_count_properties' => true,
85+
86+
/*
87+
|--------------------------------------------------------------------------
88+
| Write Eloquent Model Mixins
89+
|--------------------------------------------------------------------------
90+
|
91+
| This will add the necessary DocBlock mixins to the model class
92+
| contained in the Laravel Framework. This helps the IDE with
93+
| auto-completion.
94+
|
95+
| Please be aware that this setting changes a file within the /vendor directory.
96+
|
97+
*/
98+
99+
'write_eloquent_model_mixins' => false,
100+
101+
/*
102+
|--------------------------------------------------------------------------
103+
| Helper files to include
104+
|--------------------------------------------------------------------------
105+
|
106+
| Include helper files. By default not included, but can be toggled with the
107+
| -- helpers (-H) option. Extra helper files can be included.
108+
|
109+
*/
110+
111+
'include_helpers' => false,
112+
113+
'helper_files' => [
114+
base_path() . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php',
115+
],
116+
117+
/*
118+
|--------------------------------------------------------------------------
119+
| Model locations to include
120+
|--------------------------------------------------------------------------
121+
|
122+
| Define in which directories the ide-helper:models command should look
123+
| for models.
124+
|
125+
| glob patterns are supported to easier reach models in sub-directories,
126+
| e.g. `app/Services/* /Models` (without the space)
127+
|
128+
*/
129+
130+
'model_locations' => [
131+
'app',
132+
],
133+
134+
/*
135+
|--------------------------------------------------------------------------
136+
| Models to ignore
137+
|--------------------------------------------------------------------------
138+
|
139+
| Define which models should be ignored.
140+
|
141+
*/
142+
143+
'ignored_models' => [
144+
145+
],
146+
147+
/*
148+
|--------------------------------------------------------------------------
149+
| Extra classes
150+
|--------------------------------------------------------------------------
151+
|
152+
| These implementations are not really extended, but called with magic functions
153+
|
154+
*/
155+
156+
'extra' => [
157+
'Eloquent' => ['Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'],
158+
'Session' => ['Illuminate\Session\Store'],
159+
],
160+
161+
'magic' => [],
162+
163+
/*
164+
|--------------------------------------------------------------------------
165+
| Interface implementations
166+
|--------------------------------------------------------------------------
167+
|
168+
| These interfaces will be replaced with the implementing class. Some interfaces
169+
| are detected by the helpers, others can be listed below.
170+
|
171+
*/
172+
173+
'interfaces' => [
174+
175+
],
176+
177+
/*
178+
|--------------------------------------------------------------------------
179+
| Support for custom DB types
180+
|--------------------------------------------------------------------------
181+
|
182+
| This setting allow you to map any custom database type (that you may have
183+
| created using CREATE TYPE statement or imported using database plugin
184+
| / extension to a Doctrine type.
185+
|
186+
| Each key in this array is a name of the Doctrine2 DBAL Platform. Currently valid names are:
187+
| 'postgresql', 'db2', 'drizzle', 'mysql', 'oracle', 'sqlanywhere', 'sqlite', 'mssql'
188+
|
189+
| This name is returned by getName() method of the specific Doctrine/DBAL/Platforms/AbstractPlatform descendant
190+
|
191+
| The value of the array is an array of type mappings. Key is the name of the custom type,
192+
| (for example, "jsonb" from Postgres 9.4) and the value is the name of the corresponding Doctrine2 type (in
193+
| our case it is 'json_array'. Doctrine types are listed here:
194+
| http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html
195+
|
196+
| So to support jsonb in your models when working with Postgres, just add the following entry to the array below:
197+
|
198+
| "postgresql" => array(
199+
| "jsonb" => "json_array",
200+
| ),
201+
|
202+
*/
203+
'custom_db_types' => [
204+
205+
],
206+
207+
/*
208+
|--------------------------------------------------------------------------
209+
| Support for camel cased models
210+
|--------------------------------------------------------------------------
211+
|
212+
| There are some Laravel packages (such as Eloquence) that allow for accessing
213+
| Eloquent model properties via camel case, instead of snake case.
214+
|
215+
| Enabling this option will support these packages by saving all model
216+
| properties as camel case, instead of snake case.
217+
|
218+
| For example, normally you would see this:
219+
|
220+
| * @property \Illuminate\Support\Carbon $created_at
221+
| * @property \Illuminate\Support\Carbon $updated_at
222+
|
223+
| With this enabled, the properties will be this:
224+
|
225+
| * @property \Illuminate\Support\Carbon $createdAt
226+
| * @property \Illuminate\Support\Carbon $updatedAt
227+
|
228+
| Note, it is currently an all-or-nothing option.
229+
|
230+
*/
231+
'model_camel_case_properties' => false,
232+
233+
/*
234+
|--------------------------------------------------------------------------
235+
| Property Casts
236+
|--------------------------------------------------------------------------
237+
|
238+
| Cast the given "real type" to the given "type".
239+
|
240+
*/
241+
'type_overrides' => [
242+
'integer' => 'int',
243+
'boolean' => 'bool',
244+
],
245+
246+
/*
247+
|--------------------------------------------------------------------------
248+
| Include DocBlocks from classes
249+
|--------------------------------------------------------------------------
250+
|
251+
| Include DocBlocks from classes to allow additional code inspection for
252+
| magic methods and properties.
253+
|
254+
*/
255+
'include_class_docblocks' => false,
256+
257+
/*
258+
|--------------------------------------------------------------------------
259+
| Force FQN usage
260+
|--------------------------------------------------------------------------
261+
|
262+
| Use the fully qualified (class) name in docBlock,
263+
| event if class exists in a given file
264+
| or there is an import (use className) of a given class
265+
|
266+
*/
267+
'force_fqn' => false,
268+
269+
/*
270+
|--------------------------------------------------------------------------
271+
| Additional relation types
272+
|--------------------------------------------------------------------------
273+
|
274+
| Sometimes it's needed to create custom relation types. The key of the array
275+
| is the Relationship Method name. The value of the array is the canonical class
276+
| name of the Relationship, e.g. `'relationName' => RelationShipClass::class`.
277+
|
278+
*/
279+
'additional_relation_types' => [],
280+
281+
];

0 commit comments

Comments
 (0)