'array', 'happened_at' => 'immutable_datetime', 'read_at' => 'immutable_datetime', ]; } /** @param array $payload */ public static function write(?int $playerId, string $type, array $payload, CarbonImmutable $at): void { if ($playerId !== null) { self::create(['player_id' => $playerId, 'type' => $type, 'payload' => $payload, 'happened_at' => $at]); } } }