Scope after-commit to PostCreated instead of the whole observer.
Restore the saved() automation afterCommit hook and let the event wait for commit on its own. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
d1d38865ef
commit
52f6506b3c
1 changed files with 2 additions and 1 deletions
|
|
@ -8,10 +8,11 @@
|
|||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Contracts\Events\ShouldDispatchAfterCommit;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class PostCreated implements ShouldBroadcast
|
||||
class PostCreated implements ShouldBroadcast, ShouldDispatchAfterCommit
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue