Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit 2e0c4db

Browse files
committed
Revert some demo content
1 parent 9875766 commit 2e0c4db

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

app/app/Events/RedirectEvent.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
namespace 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;
510
use 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
}

app/resources/views/defer.blade.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
ComponentDefer
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

0 commit comments

Comments
 (0)