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
Copy file name to clipboardExpand all lines: docs/broadcasting.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,16 +26,16 @@ You may add this tag to any Blade view passing the channel you want to listen to
26
26
/>
27
27
```
28
28
29
-
For convenience, you may prefer using the `<x-turbo-stream-from>` Blade component that ships with Turbo Laravel (it requires that you have a custom element named `<turbo-echo-stream-source>` available, since that's the tag this component will render). You may pass the model as the `source` prop to it, it will figure out the channel name for that specific model using [Laravel's conventions](https://laravel.com/docs/broadcasting#model-broadcasting-conventions):
29
+
For convenience, you may prefer using the `<x-turbo::stream-from>` Blade component that ships with Turbo Laravel (it requires that you have a custom element named `<turbo-echo-stream-source>` available, since that's the tag this component will render). You may pass the model as the `source` prop to it, it will figure out the channel name for that specific model using [Laravel's conventions](https://laravel.com/docs/broadcasting#model-broadcasting-conventions):
30
30
31
31
```blade
32
-
<x-turbo-stream-from :source="$post" />
32
+
<x-turbo::stream-from :source="$post" />
33
33
```
34
34
35
35
By default, it expects a private channel, so it must be used in a page where users are already authenticated. You may control the channel type in the tag with a `type` attribute.
Copy file name to clipboardExpand all lines: docs/helpers.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,39 +28,39 @@ Which will generate a `comments_post_123` DOM ID, assuming your Post model has a
28
28
29
29
## Blade Components
30
30
31
-
### The `<x-turbo-frame>` Blade Component
31
+
### The `<x-turbo::frame>` Blade Component
32
32
33
-
You may also prefer using the `<x-turbo-frame>` Blade component that ships with the package. This way, you don't need to worry about using the `@domid()` helper for your Turbo Frame:
33
+
You may also prefer using the `<x-turbo::frame>` Blade component that ships with the package. This way, you don't need to worry about using the `@domid()` helper for your Turbo Frame:
34
34
35
35
```blade
36
-
<x-turbo-frame :id="$post">
36
+
<x-turbo::frame :id="$post">
37
37
<!-- Content -->
38
-
</x-turbo-frame>
38
+
</x-turbo::frame>
39
39
```
40
40
41
41
To the `:id` prop, you may pass a string, which will be used as-is as the DOM ID, an Eloquent model instance, which will be passed to the `dom_id()` function that ships with the package (the same one as the `@domid()` Blade directive uses behind the scenes), or an array tuple where the first item is an instance of an Eloquent model and the second is the prefix of the DOM ID, something like this:
42
42
43
43
```blade
44
-
<x-turbo-frame :id="[$post, 'comments']">
44
+
<x-turbo::frame :id="[$post, 'comments']">
45
45
<!-- Comments -->
46
-
</x-turbo-frame>
46
+
</x-turbo::frame>
47
47
```
48
48
49
-
Additionally, you may also pass along any prop that is supported by the Turbo Frame custom Element to the `<x-turbo-frame>` Blade component, like `target`, `src`, or `loading`. These are the listed attributes, but any other attribute will also be forwarded to the `<turbo-frame>` tag that will be rendered by the `<x-turbo-frame>` component. For a full list of what's possible to do with Turbo Frames, see the [documentation](https://turbo.hotwired.dev/handbook/frames).
49
+
Additionally, you may also pass along any prop that is supported by the Turbo Frame custom Element to the `<x-turbo::frame>` Blade component, like `target`, `src`, or `loading`. These are the listed attributes, but any other attribute will also be forwarded to the `<turbo-frame>` tag that will be rendered by the `<x-turbo::frame>` component. For a full list of what's possible to do with Turbo Frames, see the [documentation](https://turbo.hotwired.dev/handbook/frames).
50
50
51
-
### The `<x-turbo-stream>` Blade Component
51
+
### The `<x-turbo::stream>` Blade Component
52
52
53
-
If you're rendering a Turbo Stream inside a your Blade files, you may use the `<x-turbo-stream>` helper:
53
+
If you're rendering a Turbo Stream inside a your Blade files, you may use the `<x-turbo::stream>` helper:
54
54
55
55
```blade
56
-
<x-turbo-stream :target="$post" action="update">
56
+
<x-turbo::stream :target="$post" action="update">
57
57
@include('posts._post', ['post' => $post])
58
-
<x-turbo-stream>
58
+
<x-turbo::stream>
59
59
```
60
60
61
61
Just like in the Turbo Frames' `:id` prop, the `:target` prop of the Turbo Stream component accepts a string, a model instance, or an array to resolve the DOM ID using the `dom_id()` function.
62
62
63
-
### The `<x-turbo-refreshes-with>` Blade Component
63
+
### The `<x-turbo::refreshes-with>` Blade Component
64
64
65
65
We can configure which update method Turbo should so to update the document:
66
66
@@ -76,10 +76,10 @@ You can also configure the scroll behavior on Turbo:
76
76
|`reset`| Resets the scroll position to the top, mimicking for the browser handles new page visits |
77
77
|`preserve`| Preserves the current scroll position (usually results in a better UX when used with the `morph` method) |
78
78
79
-
You may use the `<x-turbo-refreshes-with />` component in your main layout's `<head>` tag or on specific pages to configure how Turbo should update the page. Here's an example:
79
+
You may use the `<x-turbo::refreshes-with />` component in your main layout's `<head>` tag or on specific pages to configure how Turbo should update the page. Here's an example:
Copy file name to clipboardExpand all lines: docs/turbo-frames.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,19 +15,19 @@ The Turbo Stream tag that ships with Turbo can be used on your Blade views just
15
15
In this case, the `@domid()` directive is being used to create a dom ID that looks like this `create_comment_post_123`. There's also a Blade Component that ships with Turbo Laravel and can be used like this:
16
16
17
17
```blade
18
-
<x-turbo-frame :id="[$post, 'create_comment']">
18
+
<x-turbo::frame :id="[$post, 'create_comment']">
19
19
<p>Loading...</p>
20
-
</x-turbo-frame>
20
+
</x-turbo::frame>
21
21
```
22
22
23
23
When using the Blade Component, you don't have to worry about using the `@domid()` directive or the `dom_id()` function, as this gets handled automatically by the package. You may also pass a string if you want to enforce your own DOM ID.
24
24
25
25
Any other attribute passed to the Blade Component will get forwarded to the underlying `<turbo-frame>` element, so if you want to turn a Turbo Frame into a lazy-loading Turbo Frame using the Blade Component, you can do it like so:
Copy file name to clipboardExpand all lines: docs/turbo-streams.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,24 +291,24 @@ Remember, these are Blade views, so you have the full power of Blade at your han
291
291
@endif
292
292
```
293
293
294
-
Similar to the `<x-turbo-frame>` Blade component, there's also a `<x-turbo-stream>` Blade component that can simplify things a bit. It has the same convention of figuring out the DOM ID when you're passing a model instance or an array as `target` attribute of the `<x-turbo-frame>` component. When using the component version, there's no need to specify the template wrapper for the Turbo Stream tag, as that will be added by the component itself. So, the same example would look something like this:
294
+
Similar to the `<x-turbo::frame>` Blade component, there's also a `<x-turbo::stream>` Blade component that can simplify things a bit. It has the same convention of figuring out the DOM ID when you're passing a model instance or an array as `target` attribute of the `<x-turbo::frame>` component. When using the component version, there's no need to specify the template wrapper for the Turbo Stream tag, as that will be added by the component itself. So, the same example would look something like this:
0 commit comments