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