|
5 | 5 | return [
|
6 | 6 |
|
7 | 7 | /*
|
8 |
| - |-------------------------------------------------------------------------- |
| 8 | + |--------------------------------------------------------------------------- |
9 | 9 | | Class Namespace
|
10 |
| - |-------------------------------------------------------------------------- |
| 10 | + |--------------------------------------------------------------------------- |
11 | 11 | |
|
12 |
| - | This value sets the root namespace for Livewire component classes in |
13 |
| - | your application. This value affects component auto-discovery and |
14 |
| - | any Livewire file helper commands, like `artisan make:livewire`. |
15 |
| - | |
16 |
| - | After changing this item, run: `php artisan livewire:discover`. |
| 12 | + | This value sets the root class namespace for Livewire component classes in |
| 13 | + | your application. This value will change where component auto-discovery |
| 14 | + | finds components. It's also referenced by the file creation commands. |
17 | 15 | |
|
18 | 16 | */
|
19 | 17 |
|
20 | 18 | 'class_namespace' => 'App\\Http\\Livewire',
|
21 | 19 |
|
22 | 20 | /*
|
23 |
| - |-------------------------------------------------------------------------- |
| 21 | + |--------------------------------------------------------------------------- |
24 | 22 | | View Path
|
25 |
| - |-------------------------------------------------------------------------- |
| 23 | + |--------------------------------------------------------------------------- |
26 | 24 | |
|
27 |
| - | This value sets the path for Livewire component views. This affects |
28 |
| - | file manipulation helper commands like `artisan make:livewire`. |
| 25 | + | This value is used to specify where Livewire component Blade templates are |
| 26 | + | stored when running file creation commands like `artisan make:livewire`. |
| 27 | + | It is also used if you choose to omit a component's render() method. |
29 | 28 | |
|
30 | 29 | */
|
31 | 30 |
|
32 | 31 | 'view_path' => resource_path('views/livewire'),
|
33 | 32 |
|
34 | 33 | /*
|
35 |
| - |-------------------------------------------------------------------------- |
| 34 | + |--------------------------------------------------------------------------- |
36 | 35 | | Layout
|
37 |
| - |-------------------------------------------------------------------------- |
38 |
| - | The default layout view that will be used when rendering a component via |
39 |
| - | Route::get('/some-endpoint', SomeComponent::class);. In this case the |
40 |
| - | the view returned by SomeComponent will be wrapped in "layouts.app" |
| 36 | + |--------------------------------------------------------------------------- |
| 37 | + | The view that will be used as the layout when rendering a single component |
| 38 | + | as an entire page via `Route::get('/post/create', CreatePost::class);`. |
| 39 | + | In this case, the view returned by CreatePost will render into $slot. |
41 | 40 | |
|
42 | 41 | */
|
43 | 42 |
|
44 | 43 | 'layout' => 'layouts.app',
|
45 | 44 |
|
46 | 45 | /*
|
47 |
| - |-------------------------------------------------------------------------- |
48 |
| - | Livewire Assets URL |
49 |
| - |-------------------------------------------------------------------------- |
50 |
| - | |
51 |
| - | This value sets the path to Livewire JavaScript assets, for cases where |
52 |
| - | your app's domain root is not the correct path. By default, Livewire |
53 |
| - | will load its JavaScript assets from the app's "relative root". |
54 |
| - | |
55 |
| - | Examples: "/assets", "myurl.com/app". |
56 |
| - | |
57 |
| - */ |
58 |
| - |
59 |
| - 'asset_url' => null, |
60 |
| - |
61 |
| - /* |
62 |
| - |-------------------------------------------------------------------------- |
63 |
| - | Livewire App URL |
64 |
| - |-------------------------------------------------------------------------- |
65 |
| - | |
66 |
| - | This value should be used if livewire assets are served from CDN. |
67 |
| - | Livewire will communicate with an app through this url. |
68 |
| - | |
69 |
| - | Examples: "https://my-app.com", "myurl.com/app". |
| 46 | + |--------------------------------------------------------------------------- |
| 47 | + | Lazy Loading Placeholder |
| 48 | + |--------------------------------------------------------------------------- |
| 49 | + | Livewire allows you to lazy load components that would otherwise slow down |
| 50 | + | the initial page load. Every component can have a custom placeholder or |
| 51 | + | you can define the default placeholder view for all components below. |
70 | 52 | |
|
71 | 53 | */
|
72 | 54 |
|
73 |
| - 'app_url' => null, |
| 55 | + 'lazy_placeholder' => null, |
74 | 56 |
|
75 | 57 | /*
|
76 |
| - |-------------------------------------------------------------------------- |
77 |
| - | Livewire Endpoint Middleware Group |
78 |
| - |-------------------------------------------------------------------------- |
79 |
| - | |
80 |
| - | This value sets the middleware group that will be applied to the main |
81 |
| - | Livewire "message" endpoint (the endpoint that gets hit everytime |
82 |
| - | a Livewire component updates). It is set to "web" by default. |
83 |
| - | |
84 |
| - */ |
85 |
| - |
86 |
| - 'middleware_group' => 'web', |
87 |
| - |
88 |
| - /* |
89 |
| - |-------------------------------------------------------------------------- |
90 |
| - | Livewire Temporary File Uploads Endpoint Configuration |
91 |
| - |-------------------------------------------------------------------------- |
| 58 | + |--------------------------------------------------------------------------- |
| 59 | + | Temporary File Uploads |
| 60 | + |--------------------------------------------------------------------------- |
92 | 61 | |
|
93 | 62 | | Livewire handles file uploads by storing uploads in a temporary directory
|
94 |
| - | before the file is validated and stored permanently. All file uploads |
95 |
| - | are directed to a global endpoint for temporary storage. The config |
96 |
| - | items below are used for customizing the way the endpoint works. |
| 63 | + | before the file is stored permanently. All file uploads are directed to |
| 64 | + | a global endpoint for temporary storage. You may configure this below: |
97 | 65 | |
|
98 | 66 | */
|
99 | 67 |
|
|
108 | 76 | 'jpg', 'jpeg', 'mpga', 'webp', 'wma',
|
109 | 77 | ],
|
110 | 78 | 'max_upload_time' => 5, // Max duration (in minutes) before an upload gets invalidated.
|
| 79 | + 'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs... |
111 | 80 | ],
|
112 | 81 |
|
113 | 82 | /*
|
114 |
| - |-------------------------------------------------------------------------- |
115 |
| - | Manifest File Path |
116 |
| - |-------------------------------------------------------------------------- |
| 83 | + |--------------------------------------------------------------------------- |
| 84 | + | Render On Redirect |
| 85 | + |--------------------------------------------------------------------------- |
117 | 86 | |
|
118 |
| - | This value sets the path to the Livewire manifest file. |
119 |
| - | The default should work for most cases (which is |
120 |
| - | "<app_root>/bootstrap/cache/livewire-components.php"), but for specific |
121 |
| - | cases like when hosting on Laravel Vapor, it could be set to a different value. |
| 87 | + | This value determines if Livewire will run a component's `render()` method |
| 88 | + | after a redirect has been triggered using something like `redirect(...)` |
| 89 | + | Setting this to true will render the view once more before redirecting |
122 | 90 | |
|
123 |
| - | Example: for Laravel Vapor, it would be "/tmp/storage/bootstrap/cache/livewire-components.php". |
| 91 | + */ |
| 92 | + |
| 93 | + 'render_on_redirect' => true, |
| 94 | + |
| 95 | + /* |
| 96 | + |--------------------------------------------------------------------------- |
| 97 | + | Eloquent Model Binding |
| 98 | + |--------------------------------------------------------------------------- |
| 99 | + | |
| 100 | + | Previous versions of Livewire supported binding directly to eloquent model |
| 101 | + | properties using wire:model by default. However, this behavior has been |
| 102 | + | deemed too "magical" and has therefore been put under a feature flag. |
| 103 | + | |
| 104 | + */ |
| 105 | + |
| 106 | + 'legacy_model_binding' => false, |
| 107 | + |
| 108 | + /* |
| 109 | + |--------------------------------------------------------------------------- |
| 110 | + | Auto-inject Frontend Assets |
| 111 | + |--------------------------------------------------------------------------- |
| 112 | + | |
| 113 | + | By default, Livewire automatically injects its JavaScript and CSS into the |
| 114 | + | <head> and <body> of pages containing Livewire components. By disabling |
| 115 | + | this behavior, you need to use @livewireStyles and @livewireScripts. |
124 | 116 | |
|
125 | 117 | */
|
126 | 118 |
|
127 |
| - 'manifest_path' => null, |
| 119 | + 'inject_assets' => true, |
128 | 120 |
|
129 | 121 | /*
|
130 |
| - |-------------------------------------------------------------------------- |
131 |
| - | Back Button Cache |
132 |
| - |-------------------------------------------------------------------------- |
| 122 | + |--------------------------------------------------------------------------- |
| 123 | + | Navigate (SPA mode) |
| 124 | + |--------------------------------------------------------------------------- |
133 | 125 | |
|
134 |
| - | This value determines whether the back button cache will be used on pages |
135 |
| - | that contain Livewire. By disabling back button cache, it ensures that |
136 |
| - | the back button shows the correct state of components, instead of |
137 |
| - | potentially stale, cached data. |
| 126 | + | By adding `wire:navigate` to links in your Livewire application, Livewire |
| 127 | + | will prevent the default link handling and instead request those pages |
| 128 | + | via AJAX, creating an SPA-like effect. Configure this behavior here. |
138 | 129 | |
|
139 |
| - | Setting it to "false" (default) will disable back button cache. |
| 130 | + */ |
| 131 | + |
| 132 | + 'navigate' => [ |
| 133 | + 'show_progress_bar' => true, |
| 134 | + 'progress_bar_color' => '#2299dd', |
| 135 | + ], |
| 136 | + |
| 137 | + /* |
| 138 | + |--------------------------------------------------------------------------- |
| 139 | + | HTML Morph Markers |
| 140 | + |--------------------------------------------------------------------------- |
| 141 | + | |
| 142 | + | Livewire intelligently "morphs" existing HTML into the newly rendered HTML |
| 143 | + | after each update. To make this process more reliable, Livewire injects |
| 144 | + | "markers" into the rendered Blade surrounding @if, @class & @foreach. |
140 | 145 | |
|
141 | 146 | */
|
142 | 147 |
|
143 |
| - 'back_button_cache' => false, |
| 148 | + 'inject_morph_markers' => true, |
144 | 149 |
|
145 | 150 | /*
|
146 |
| - |-------------------------------------------------------------------------- |
147 |
| - | Render On Redirect |
148 |
| - |-------------------------------------------------------------------------- |
| 151 | + |--------------------------------------------------------------------------- |
| 152 | + | Pagination Theme |
| 153 | + |--------------------------------------------------------------------------- |
149 | 154 | |
|
150 |
| - | This value determines whether Livewire will render before it's redirected |
151 |
| - | or not. Setting it to "false" (default) will mean the render method is |
152 |
| - | skipped when redirecting. And "true" will mean the render method is |
153 |
| - | run before redirecting. Browsers bfcache can store a potentially |
154 |
| - | stale view if render is skipped on redirect. |
| 155 | + | When enabling Livewire's pagination feature by using the `WithPagination` |
| 156 | + | trait, Livewire will use Tailwind templates to render pagination views |
| 157 | + | on the page. If you want Bootstrap CSS, you can specify: "bootstrap" |
155 | 158 | |
|
156 | 159 | */
|
157 | 160 |
|
158 |
| - 'render_on_redirect' => true, |
| 161 | + 'pagination_theme' => 'tailwind', |
159 | 162 |
|
160 | 163 | ];
|
0 commit comments