modules.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. use Nwidart\Modules\Activators\FileActivator;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Module Namespace
  7. |--------------------------------------------------------------------------
  8. |
  9. | Default module namespace.
  10. |
  11. */
  12. 'namespace' => 'Modules',
  13. /*
  14. |--------------------------------------------------------------------------
  15. | Module Stubs
  16. |--------------------------------------------------------------------------
  17. |
  18. | Default module stubs.
  19. |
  20. */
  21. 'stubs' => [
  22. 'enabled' => false,
  23. 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs',
  24. 'files' => [
  25. 'routes/web' => 'Routes/web.php',
  26. 'routes/api' => 'Routes/api.php',
  27. 'views/index' => 'Resources/views/index.blade.php',
  28. 'views/master' => 'Resources/views/layouts/master.blade.php',
  29. 'scaffold/config' => 'Config/config.php',
  30. 'composer' => 'composer.json',
  31. 'assets/js/app' => 'Resources/assets/js/app.js',
  32. 'assets/sass/app' => 'Resources/assets/sass/app.scss',
  33. 'webpack' => 'webpack.mix.js',
  34. 'package' => 'package.json',
  35. ],
  36. 'replacements' => [
  37. 'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'],
  38. 'routes/api' => ['LOWER_NAME'],
  39. 'webpack' => ['LOWER_NAME'],
  40. 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'],
  41. 'views/index' => ['LOWER_NAME'],
  42. 'views/master' => ['LOWER_NAME', 'STUDLY_NAME'],
  43. 'scaffold/config' => ['STUDLY_NAME'],
  44. 'composer' => [
  45. 'LOWER_NAME',
  46. 'STUDLY_NAME',
  47. 'VENDOR',
  48. 'AUTHOR_NAME',
  49. 'AUTHOR_EMAIL',
  50. 'MODULE_NAMESPACE',
  51. 'PROVIDER_NAMESPACE',
  52. ],
  53. ],
  54. 'gitkeep' => true,
  55. ],
  56. 'paths' => [
  57. /*
  58. |--------------------------------------------------------------------------
  59. | Modules path
  60. |--------------------------------------------------------------------------
  61. |
  62. | This path used for save the generated module. This path also will be added
  63. | automatically to list of scanned folders.
  64. |
  65. */
  66. 'modules' => base_path('Modules'),
  67. /*
  68. |--------------------------------------------------------------------------
  69. | Modules assets path
  70. |--------------------------------------------------------------------------
  71. |
  72. | Here you may update the modules assets path.
  73. |
  74. */
  75. 'assets' => public_path('modules'),
  76. /*
  77. |--------------------------------------------------------------------------
  78. | The migrations path
  79. |--------------------------------------------------------------------------
  80. |
  81. | Where you run 'module:publish-migration' command, where do you publish the
  82. | the migration files?
  83. |
  84. */
  85. 'migration' => base_path('database/migrations'),
  86. /*
  87. |--------------------------------------------------------------------------
  88. | Generator path
  89. |--------------------------------------------------------------------------
  90. | Customise the paths where the folders will be generated.
  91. | Set the generate key to false to not generate that folder
  92. */
  93. 'generator' => [
  94. 'config' => ['path' => 'Config', 'generate' => true],
  95. 'command' => ['path' => 'Console', 'generate' => true],
  96. 'migration' => ['path' => 'Database/Migrations', 'generate' => true],
  97. 'seeder' => ['path' => 'Database/Seeders', 'generate' => true],
  98. 'factory' => ['path' => 'Database/factories', 'generate' => true],
  99. 'model' => ['path' => 'Entities', 'generate' => true],
  100. 'routes' => ['path' => 'Routes', 'generate' => true],
  101. 'controller' => ['path' => 'Http/Controllers', 'generate' => true],
  102. 'filter' => ['path' => 'Http/Middleware', 'generate' => true],
  103. 'request' => ['path' => 'Http/Requests', 'generate' => true],
  104. 'provider' => ['path' => 'Providers', 'generate' => true],
  105. 'assets' => ['path' => 'Resources/assets', 'generate' => true],
  106. 'lang' => ['path' => 'Resources/lang', 'generate' => true],
  107. 'views' => ['path' => 'Resources/views', 'generate' => true],
  108. 'test' => ['path' => 'Tests/Unit', 'generate' => true],
  109. 'test-feature' => ['path' => 'Tests/Feature', 'generate' => true],
  110. 'repository' => ['path' => 'Repositories', 'generate' => false],
  111. 'event' => ['path' => 'Events', 'generate' => false],
  112. 'listener' => ['path' => 'Listeners', 'generate' => false],
  113. 'policies' => ['path' => 'Policies', 'generate' => false],
  114. 'rules' => ['path' => 'Rules', 'generate' => false],
  115. 'jobs' => ['path' => 'Jobs', 'generate' => false],
  116. 'emails' => ['path' => 'Emails', 'generate' => false],
  117. 'notifications' => ['path' => 'Notifications', 'generate' => false],
  118. 'resource' => ['path' => 'Transformers', 'generate' => false],
  119. ],
  120. ],
  121. /*
  122. |--------------------------------------------------------------------------
  123. | Scan Path
  124. |--------------------------------------------------------------------------
  125. |
  126. | Here you define which folder will be scanned. By default will scan vendor
  127. | directory. This is useful if you host the package in packagist website.
  128. |
  129. */
  130. 'scan' => [
  131. 'enabled' => false,
  132. 'paths' => [
  133. base_path('vendor/*/*'),
  134. ],
  135. ],
  136. /*
  137. |--------------------------------------------------------------------------
  138. | Composer File Template
  139. |--------------------------------------------------------------------------
  140. |
  141. | Here is the config for composer.json file, generated by this package
  142. |
  143. */
  144. 'composer' => [
  145. 'vendor' => 'nwidart',
  146. 'author' => [
  147. 'name' => 'Nicolas Widart',
  148. 'email' => 'n.widart@gmail.com',
  149. ],
  150. ],
  151. /*
  152. |--------------------------------------------------------------------------
  153. | Caching
  154. |--------------------------------------------------------------------------
  155. |
  156. | Here is the config for setting up caching feature.
  157. |
  158. */
  159. 'cache' => [
  160. 'enabled' => false,
  161. 'key' => 'laravel-modules',
  162. 'lifetime' => 60,
  163. ],
  164. /*
  165. |--------------------------------------------------------------------------
  166. | Choose what laravel-modules will register as custom namespaces.
  167. | Setting one to false will require you to register that part
  168. | in your own Service Provider class.
  169. |--------------------------------------------------------------------------
  170. */
  171. 'register' => [
  172. 'translations' => true,
  173. /**
  174. * load files on boot or register method
  175. *
  176. * Note: boot not compatible with asgardcms
  177. *
  178. * @example boot|register
  179. */
  180. 'files' => 'register',
  181. ],
  182. /*
  183. |--------------------------------------------------------------------------
  184. | Activators
  185. |--------------------------------------------------------------------------
  186. |
  187. | You can define new types of activators here, file, database etc. The only
  188. | required parameter is 'class'.
  189. | The file activator will store the activation status in storage/installed_modules
  190. */
  191. 'activators' => [
  192. 'file' => [
  193. 'class' => FileActivator::class,
  194. 'statuses-file' => base_path('modules_statuses.json'),
  195. 'cache-key' => 'activator.installed',
  196. 'cache-lifetime' => 604800,
  197. ],
  198. ],
  199. 'activator' => 'file',
  200. ];