Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

Scope after-commit to PostCreated instead of the whole observer.

Paulo Castellano52f6506b3cfa
diff --git a/app/Events/PostCreated.php b/app/Events/PostCreated.php
index 013f20d50..6234ba0ee 100644
--- a/app/Events/PostCreated.php
+++ b/app/Events/PostCreated.php
@@ -8,10 +8,11 @@ use App\Models\Post;
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;