wasChanged('status') && $post->status === 'published') { MemberPoint::create([ 'user_id' => $post->author_id, 'points' => 5, 'reason' => "Artikel dipublikasi: {$post->title}", 'source_type' => 'post', 'source_id' => $post->id, ]); } } }