ide-helper.php 10 KB

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