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.

Revert observer-wide after-commit; keep saved() job hook.

Paulo Castellano254b7d514ba8
diff --git a/app/Observers/PostObserver.php b/app/Observers/PostObserver.php
index c9cfd84a7..be6a3e6c0 100644
--- a/app/Observers/PostObserver.php
+++ b/app/Observers/PostObserver.php
@@ -9,9 +9,8 @@ use App\Enums\Post\Status as PostStatus;
use App\Events\PostCreated;
use App\Jobs\Automation\DispatchPostTriggerAutomationsJob;
use App\Models\Post;
-use Illuminate\Contracts\Events\ShouldHandleEventsAfterCommit;
-class PostObserver implements ShouldHandleEventsAfterCommit
+class PostObserver
{
public function created(Post $post): void
{
@@ -34,6 +33,6 @@ class PostObserver implements ShouldHandleEventsAfterCommit
return;
}
- DispatchPostTriggerAutomationsJob::dispatch($post, $triggerType);
+ DispatchPostTriggerAutomationsJob::dispatch($post, $triggerType)->afterCommit();
}
}