ide-helper.php 9.8 KB

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