|
30 | 30 |
|
31 | 31 | /* |
32 | 32 | |--------------------------------------------------------------------------- |
33 | | - | Layout |
| 33 | + | Component Layout |
34 | 34 | |--------------------------------------------------------------------------- |
35 | 35 | | The view that will be used as the layout when rendering a single component |
36 | | - | as an entire page via `Route::get('/post/create', CreatePost::class);`. |
| 36 | + | as an entire page via `Route::livewire('/post/create', CreatePost::class);`. |
37 | 37 | | In this case, the view returned by CreatePost will render into $slot. |
38 | 38 | | |
39 | 39 | */ |
40 | 40 |
|
41 | | - 'layout' => 'components.layouts.app', |
| 41 | + 'component_layout' => 'components.layouts.app', |
42 | 42 |
|
43 | 43 | /* |
44 | 44 | |--------------------------------------------------------------------------- |
45 | | - | Lazy Loading Placeholder |
| 45 | + | Component Placeholder |
46 | 46 | |--------------------------------------------------------------------------- |
47 | 47 | | Livewire allows you to lazy load components that would otherwise slow down |
48 | 48 | | the initial page load. Every component can have a custom placeholder or |
49 | 49 | | you can define the default placeholder view for all components below. |
50 | 50 | | |
51 | 51 | */ |
52 | 52 |
|
53 | | - 'lazy_placeholder' => null, |
| 53 | + 'component_placeholder' => null, |
| 54 | + |
| 55 | + /* |
| 56 | + |--------------------------------------------------------------------------- |
| 57 | + | Component Locations |
| 58 | + |--------------------------------------------------------------------------- |
| 59 | + | Defines where Livewire looks for single-file and multi-file (view-based) |
| 60 | + | components. This allows you to organize your components in different |
| 61 | + | directories while maintaining Livewire's auto-discovery features. |
| 62 | + | |
| 63 | + */ |
| 64 | + |
| 65 | + 'component_locations' => [ |
| 66 | + resource_path('views/components'), |
| 67 | + resource_path('views/livewire'), |
| 68 | + ], |
| 69 | + |
| 70 | + /* |
| 71 | + |--------------------------------------------------------------------------- |
| 72 | + | Component Namespaces |
| 73 | + |--------------------------------------------------------------------------- |
| 74 | + | Creates custom namespaces for organizing view-based components. |
| 75 | + | For example, 'layouts' => resource_path('views/layouts') allows you to |
| 76 | + | use <livewire:layouts::app /> for views/layouts/app.blade.php. |
| 77 | + | |
| 78 | + */ |
| 79 | + |
| 80 | + 'component_namespaces' => [ |
| 81 | + 'layouts' => resource_path('views/layouts'), |
| 82 | + 'pages' => resource_path('views/pages'), |
| 83 | + ], |
| 84 | + |
| 85 | + /* |
| 86 | + |--------------------------------------------------------------------------- |
| 87 | + | Make Command Defaults |
| 88 | + |--------------------------------------------------------------------------- |
| 89 | + | Configure default component format and emoji usage when generating |
| 90 | + | new components with php artisan make:livewire command. |
| 91 | + | Options: 'sfc' (single-file), 'mfc' (multi-file), or 'class'. |
| 92 | + | |
| 93 | + */ |
| 94 | + |
| 95 | + 'make_command' => [ |
| 96 | + 'type' => 'class', // Using 'class' to match v3 behavior |
| 97 | + 'emoji' => false, // Set to false to avoid emoji prefixes |
| 98 | + ], |
| 99 | + |
| 100 | + /* |
| 101 | + |--------------------------------------------------------------------------- |
| 102 | + | Smart wire:key Behavior |
| 103 | + |--------------------------------------------------------------------------- |
| 104 | + | Helps prevent wire:key issues on deeply nested components. When enabled, |
| 105 | + | Livewire automatically generates smarter keys for nested components. |
| 106 | + | Note: You still need to add wire:key manually in loops. |
| 107 | + | |
| 108 | + */ |
| 109 | + |
| 110 | + 'smart_wire_keys' => true, |
| 111 | + |
| 112 | + /* |
| 113 | + |--------------------------------------------------------------------------- |
| 114 | + | CSP-Safe Mode |
| 115 | + |--------------------------------------------------------------------------- |
| 116 | + | Enable Content Security Policy mode to avoid unsafe-eval violations. |
| 117 | + | When enabled, Livewire uses the Alpine CSP build. Note: This mode |
| 118 | + | restricts complex JavaScript expressions in directives. |
| 119 | + | |
| 120 | + */ |
| 121 | + |
| 122 | + 'csp_safe' => false, |
54 | 123 |
|
55 | 124 | /* |
56 | 125 | |--------------------------------------------------------------------------- |
|
0 commit comments