Skip to content

A free open source IT asset/license management system

Migrate config

Marcus Moore4c727966e73c
diff --git a/config/livewire.php b/config/livewire.php
index d9db384bd6..d84b6f4e58 100644
--- a/config/livewire.php
+++ b/config/livewire.php
@@ -4,41 +4,47 @@ return [
/*
|---------------------------------------------------------------------------
- | Class Namespace
+ | Component Locations
|---------------------------------------------------------------------------
|
- | This value sets the root class namespace for Livewire component classes in
- | your application. This value will change where component auto-discovery
- | finds components. It's also referenced by the file creation commands.
+ | This value sets the root directories that'll be used to resolve view-based
+ | components like single and multi-file components. The make command will
+ | use the first directory in this array to add new component files to.
|
*/
- 'class_namespace' => 'App\\Livewire',
+ 'component_locations' => [
+ resource_path('views/components'),
+ resource_path('views/livewire'),
+ ],
/*
|---------------------------------------------------------------------------
- | View Path
+ | Component Namespaces
|---------------------------------------------------------------------------
|
- | This value is used to specify where Livewire component Blade templates are
- | stored when running file creation commands like `artisan make:livewire`.
- | It is also used if you choose to omit a component's render() method.
+ | This value sets default namespaces that will be used to resolve view-based
+ | components like single-file and multi-file components. These folders'll
+ | also be referenced when creating new components via the make command.
|
*/
- 'view_path' => resource_path('views/livewire'),
+ 'component_namespaces' => [
+ 'layouts' => resource_path('views/layouts'),
+ 'pages' => resource_path('views/pages'),
+ ],
/*
|---------------------------------------------------------------------------
- | Layout
+ | Page Layout
|---------------------------------------------------------------------------
- | The view that will be used as the layout when rendering a single component
- | as an entire page via `Route::get('/post/create', CreatePost::class);`.
- | In this case, the view returned by CreatePost will render into $slot.
+ | The view that will be used as the layout when rendering a single component as
+ | an entire page via `Route::livewire('/post/create', 'pages::create-post')`.
+ | In this case, the content of pages::create-post will render into $slot.
|
*/
- 'layout' => 'components.layouts.app',
+ 'component_layout' => 'layouts::app',
/*
|---------------------------------------------------------------------------
@@ -50,7 +56,66 @@ return [
|
*/
- 'lazy_placeholder' => null,
+ 'component_placeholder' => null, // Example: 'placeholders::skeleton'
+
+ /*
+ |---------------------------------------------------------------------------
+ | Make Command
+ |---------------------------------------------------------------------------
+ | This value determines the default configuration for the artisan make command
+ | You can configure the component type (sfc, mfc, class) and whether to use
+ | the high-voltage (⚡) emoji as a prefix in the sfc|mfc component names.
+ |
+ */
+
+ 'make_command' => [
+ 'type' => 'sfc', // Options: 'sfc', 'mfc', 'class'
+ 'emoji' => true, // Options: true, false
+ 'with' => [
+ 'js' => false,
+ 'css' => false,
+ 'test' => false,
+ ],
+ ],
+
+ /*
+ |---------------------------------------------------------------------------
+ | Class Namespace
+ |---------------------------------------------------------------------------
+ |
+ | This value sets the root class namespace for Livewire component classes in
+ | your application. This value will change where component auto-discovery
+ | finds components. It's also referenced by the file creation commands.
+ |
+ */
+
+ 'class_namespace' => 'App\\Livewire',
+
+ /*
+ |---------------------------------------------------------------------------
+ | Class Path
+ |---------------------------------------------------------------------------
+ |
+ | This value is used to specify the path where Livewire component class files
+ | are created when running creation commands like `artisan make:livewire`.
+ | This path is customizable to match your projects directory structure.
+ |
+ */
+
+ 'class_path' => app_path('Livewire'),
+
+ /*
+ |---------------------------------------------------------------------------
+ | View Path
+ |---------------------------------------------------------------------------
+ |
+ | This value is used to specify where Livewire component Blade templates are
+ | stored when running file creation commands like `artisan make:livewire`.
+ | It is also used if you choose to omit a component's render() method.
+ |
+ */
+
+ 'view_path' => resource_path('views/livewire'),
/*
|---------------------------------------------------------------------------
@@ -145,6 +210,19 @@ return [
'inject_morph_markers' => true,
+ /*
+ |---------------------------------------------------------------------------
+ | Smart Wire Keys
+ |---------------------------------------------------------------------------
+ |
+ | Livewire uses loops and keys used within loops to generate smart keys that
+ | are applied to nested components that don't have them. This makes using
+ | nested components more reliable by ensuring that they all have keys.
+ |
+ */
+
+ 'smart_wire_keys' => true,
+
/*
|---------------------------------------------------------------------------
| Pagination Theme
@@ -160,18 +238,45 @@ return [
/*
|---------------------------------------------------------------------------
- | URL Prefix
+ | Release Token
|---------------------------------------------------------------------------
|
- | By default, Livewire sends network requests to {app.com}/livewire/update
- | while javascript assets are served via {app.com}/livewire/livewire.js
- | If you need to adjust the prefix of those urls you can do it below.
+ | This token is stored client-side and sent along with each request to check
+ | a users session to see if a new release has invalidated it. If there is
+ | a mismatch it will throw an error and prompt for a browser refresh.
+ |
+ */
+
+ 'release_token' => 'a',
+
+ /*
+ |---------------------------------------------------------------------------
+ | CSP Safe
+ |---------------------------------------------------------------------------
|
- | Defining a prefix will result in the following url
- | {app.com}/{prefix}/livewire/{update|livewire.js}
- | Note: do not include the leading or trailing /
+ | This config is used to determine if Livewire will use the CSP-safe version
+ | of Alpine in its bundle. This is useful for applications that are using
+ | strict Content Security Policy (CSP) to protect against XSS attacks.
|
*/
- 'url_prefix' => env('LIVEWIRE_URL_PREFIX', null),
+ 'csp_safe' => false,
+
+ /*
+ |---------------------------------------------------------------------------
+ | Payload Guards
+ |---------------------------------------------------------------------------
+ |
+ | These settings protect against malicious or oversized payloads that could
+ | cause denial of service. The default values should feel reasonable for
+ | most web applications. Each can be set to null to disable the limit.
+ |
+ */
+
+ 'payload' => [
+ 'max_size' => 1024 * 1024, // 1MB - maximum request payload size in bytes
+ 'max_nesting_depth' => 10, // Maximum depth of dot-notation property paths
+ 'max_calls' => 50, // Maximum method calls per request
+ 'max_components' => 20, // Maximum components per batch request
+ ],
];