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