livewire.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Class Namespace
  6. |--------------------------------------------------------------------------
  7. |
  8. | This value sets the root namespace for Livewire component classes in
  9. | your application. This value affects component auto-discovery and
  10. | any Livewire file helper commands, like `artisan make:livewire`.
  11. |
  12. | After changing this item, run: `php artisan livewire:discover`.
  13. |
  14. */
  15. 'class_namespace' => 'App\\Http\\Livewire',
  16. /*
  17. |--------------------------------------------------------------------------
  18. | View Path
  19. |--------------------------------------------------------------------------
  20. |
  21. | This value sets the path for Livewire component views. This affects
  22. | file manipulation helper commands like `artisan make:livewire`.
  23. |
  24. */
  25. 'view_path' => resource_path('views/livewire'),
  26. /*
  27. |--------------------------------------------------------------------------
  28. | Layout
  29. |--------------------------------------------------------------------------
  30. | The default layout view that will be used when rendering a component via
  31. | Route::get('/some-endpoint', SomeComponent::class);. In this case the
  32. | the view returned by SomeComponent will be wrapped in "layouts.app"
  33. |
  34. */
  35. 'layout' => 'layouts.app',
  36. /*
  37. |--------------------------------------------------------------------------
  38. | Livewire Assets URL
  39. |--------------------------------------------------------------------------
  40. |
  41. | This value sets the path to Livewire JavaScript assets, for cases where
  42. | your app's domain root is not the correct path. By default, Livewire
  43. | will load its JavaScript assets from the app's "relative root".
  44. |
  45. | Examples: "/assets", "myurl.com/app".
  46. |
  47. */
  48. 'asset_url' => null,
  49. /*
  50. |--------------------------------------------------------------------------
  51. | Livewire App URL
  52. |--------------------------------------------------------------------------
  53. |
  54. | This value should be used if livewire assets are served from CDN.
  55. | Livewire will communicate with an app through this url.
  56. |
  57. | Examples: "https://my-app.com", "myurl.com/app".
  58. |
  59. */
  60. 'app_url' => null,
  61. /*
  62. |--------------------------------------------------------------------------
  63. | Livewire Endpoint Middleware Group
  64. |--------------------------------------------------------------------------
  65. |
  66. | This value sets the middleware group that will be applied to the main
  67. | Livewire "message" endpoint (the endpoint that gets hit everytime
  68. | a Livewire component updates). It is set to "web" by default.
  69. |
  70. */
  71. 'middleware_group' => 'web',
  72. /*
  73. |--------------------------------------------------------------------------
  74. | Livewire Temporary File Uploads Endpoint Configuration
  75. |--------------------------------------------------------------------------
  76. |
  77. | Livewire handles file uploads by storing uploads in a temporary directory
  78. | before the file is validated and stored permanently. All file uploads
  79. | are directed to a global endpoint for temporary storage. The config
  80. | items below are used for customizing the way the endpoint works.
  81. |
  82. */
  83. 'temporary_file_upload' => [
  84. 'disk' => null, // Example: 'local', 's3' Default: 'default'
  85. //'rules' => null, // Example: ['file', 'mimes:png,jpg'] Default: ['required', 'file', 'max:12288'] (12MB)
  86. 'rules' => 'file|mimes:png,jpg,pdf|max:102400', // (100MB max, and only pngs, jpegs, and pdfs.)
  87. 'directory' => null, // Example: 'tmp' Default 'livewire-tmp'
  88. 'middleware' => null, // Example: 'throttle:5,1' Default: 'throttle:60,1'
  89. 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs.
  90. 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
  91. 'mov', 'avi', 'wmv', 'mp3', 'm4a',
  92. 'jpg', 'jpeg', 'mpga', 'webp', 'wma',
  93. ],
  94. 'max_upload_time' => 5, // Max duration (in minutes) before an upload gets invalidated.
  95. ],
  96. /*
  97. |--------------------------------------------------------------------------
  98. | Manifest File Path
  99. |--------------------------------------------------------------------------
  100. |
  101. | This value sets the path to the Livewire manifest file.
  102. | The default should work for most cases (which is
  103. | "<app_root>/bootstrap/cache/livewire-components.php"), but for specific
  104. | cases like when hosting on Laravel Vapor, it could be set to a different value.
  105. |
  106. | Example: for Laravel Vapor, it would be "/tmp/storage/bootstrap/cache/livewire-components.php".
  107. |
  108. */
  109. 'manifest_path' => null,
  110. /*
  111. |--------------------------------------------------------------------------
  112. | Back Button Cache
  113. |--------------------------------------------------------------------------
  114. |
  115. | This value determines whether the back button cache will be used on pages
  116. | that contain Livewire. By disabling back button cache, it ensures that
  117. | the back button shows the correct state of components, instead of
  118. | potentially stale, cached data.
  119. |
  120. | Setting it to "false" (default) will disable back button cache.
  121. |
  122. */
  123. 'back_button_cache' => false,
  124. /*
  125. |--------------------------------------------------------------------------
  126. | Render On Redirect
  127. |--------------------------------------------------------------------------
  128. |
  129. | This value determines whether Livewire will render before it's redirected
  130. | or not. Setting it to "false" (default) will mean the render method is
  131. | skipped when redirecting. And "true" will mean the render method is
  132. | run before redirecting. Browsers bfcache can store a potentially
  133. | stale view if render is skipped on redirect.
  134. |
  135. */
  136. 'render_on_redirect' => false,
  137. ];