This repository was archived by the owner on Oct 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Events ;
44
5+ use Illuminate \Broadcasting \InteractsWithSockets ;
6+ use Illuminate \Broadcasting \PrivateChannel ;
7+ use Illuminate \Contracts \Broadcasting \ShouldBroadcastNow ;
8+ use Illuminate \Foundation \Events \Dispatchable ;
9+ use Illuminate \Queue \SerializesModels ;
510use ProtoneMedia \Splade \Facades \Splade ;
611
7- class OrderWasShipped implements ShouldBroadcastNow
12+ class RedirectEvent implements ShouldBroadcastNow
813{
14+ use Dispatchable, InteractsWithSockets, SerializesModels;
15+
916 public function broadcastOn ()
1017 {
1118 return new PrivateChannel ('Splade ' );
@@ -14,13 +21,7 @@ public function broadcastOn()
1421 public function broadcastWith ()
1522 {
1623 return [
17- Splade::refreshOnEvent (),
18-
1924 Splade::redirectOnEvent ()->route ('navigation.one ' ),
20-
21- Splade::toastOnEvent ('Your order was shipped! ' )
22- ->rightBottom ()
23- ->info (),
2425 ];
2526 }
2627}
Original file line number Diff line number Diff line change 44
55ComponentDefer
66
7- <x-data default =" { counter: 1 }" >
8- <button @click =" data.counter++" >Increase</button >
9- <x-defer url =" /defer/api" v-bind:request =" data" poll =" 5000" method =" POST" />
10- </x-data >
7+ <x-splade-data scope =" requestData" v-bind:default =" { api: 'one' }" >
8+ <x-splade-defer url =" /defer/api" v-bind:request =" requestData" method =" post" >
9+ <p v-if =" processing" >Loading...</p >
10+ <p v-text =" response" />
11+ <button dusk =" reload" @click .prevent =" () => { requestData.api = 'two'; reload(); }" >Again!</button >
12+ </x-splade-defer >
13+ </x-splade-data >
1114
1215@endsection
You can’t perform that action at this time.
0 commit comments