You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick updates on docs, since Livewire v3 a lot of thing changed 😬 (#97)
* quick updates on docs, since Livewire v3 a lot of thing changed
* more details
* Update docs/livewire.md
Co-authored-by: qwerty287 <[email protected]>
We first give a short intuition of how Livewire, the framework of the new front-end, works.
3
+
We first give a short intuition of how [Livewire](https://livewire.laravel.com/docs/quickstart), the framework of the new front-end, works.
4
4
5
5
### Livewire and Controllers
6
6
7
7
The Laravel framework on which Lychee is based provides two options regarding how a request may be routed:
8
8
9
9
- the request is directed to a controller below `app/Http/Controllers`
10
-
- the request is directed to a Livewire component below `app/Http/Livewire`
10
+
- the request is directed to a Livewire component below `app/Livewire/Components`
11
11
12
12
In the first case, a controller returns a JSON object or an HTML page rendered from a blade template.
13
13
In the second case (Livewire), only a block of HTML built from a blade template will be returned.
14
14
15
15
From a very high level, Livewire makes use of two folders:
16
16
17
-
-`app/Http/Livewire` which hosts the components and their inner logic.
18
-
-`resources/views/components` which hosts the HTML layout of the components.
17
+
-`app/Livewire/Components` which hosts the components and their inner logic.
18
+
-`resources/views/{components|livewire}` which hosts the HTML layout of the components.
19
19
20
20
So far one could say there is not much difference with a normal request life cycle. Where Livewire starts to shine is in the ability to call the methods of the component directly _from HTML_. Instead of having to use a JavaScript hook, make an AJAX call, parse the result, and update the layout accordingly, the user/programmer can directly interact with the designated component and Livewire takes care of the request and rendering.
21
21
@@ -37,7 +37,7 @@ Laravel then calls the `render()` method and returns the corresponding view.
37
37
```php
38
38
public function render()
39
39
{
40
-
return view('components.molecules.album');
40
+
return view('components.gallery.album');
41
41
}
42
42
43
43
```
@@ -57,9 +57,9 @@ One could say that the Livewire components are just Laravel components on steroi
57
57
58
58
In order to call Livewire, the following syntax is used:
0 commit comments