File tree Expand file tree Collapse file tree 2 files changed +5
-31
lines changed Expand file tree Collapse file tree 2 files changed +5
-31
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public function exceptForSocket(string $socket = null): self
18
18
return $ this ;
19
19
}
20
20
21
- public function create ($ model ): void
21
+ public function create (Model $ model ): void
22
22
{
23
23
$ action = property_exists ($ model , 'turboStreamCreatedAction ' )
24
24
? $ model ->turboStreamCreatedAction
@@ -30,7 +30,7 @@ public function create($model): void
30
30
));
31
31
}
32
32
33
- public function update ($ model ): void
33
+ public function update (Model $ model ): void
34
34
{
35
35
$ action = property_exists ($ model , 'turboStreamUpdatedAction ' )
36
36
? $ model ->turboStreamUpdatedAction
Original file line number Diff line number Diff line change @@ -60,8 +60,9 @@ public function queueBroadcastUpdatedToHotwire()
60
60
61
61
public function queueBroadcastRemovalToHotwire ()
62
62
{
63
- // Removals cannot be cached because we need to gather the broadcasting targets
64
- // using the model instance's relationships before the entity is "gone".
63
+ // We cannot queue removal broadcasts because the model will be gone once the worker
64
+ // picks up the job to process the broadcasting. So we are broadcasting after the
65
+ // response is sent to back to the user, before the PHP process is terminated.
65
66
66
67
app ()->terminating (function () {
67
68
$ this ->hotwireBroadcastUsing ()
@@ -74,31 +75,4 @@ public function hotwireBroadcastUsing()
74
75
{
75
76
return resolve (LaravelBroadcaster::class);
76
77
}
77
-
78
- public function hotwireTargetDomId ()
79
- {
80
- return $ this ->hotwireResolveNamesUsing ()->domIdFor ($ this );
81
- }
82
-
83
- public function hotwireTargetResourcesName ()
84
- {
85
- return $ this ->hotwireResolveNamesUsing ()->resourceName ($ this );
86
- }
87
-
88
- public function hotwireResolveNamesUsing (): NamesResolver
89
- {
90
- return resolve (NamesResolver::class);
91
- }
92
-
93
- public function hotwirePartialName ()
94
- {
95
- return $ this ->hotwireResolveNamesUsing ()->partialNameFor ($ this );
96
- }
97
-
98
- public function hotwirePartialData ()
99
- {
100
- return [
101
- $ this ->hotwireResolveNamesUsing ()->resourceVariableName ($ this ) => $ this ,
102
- ];
103
- }
104
78
}
You can’t perform that action at this time.
0 commit comments