['{"date":"token","time":"token2","doctor":"token10"}', 'نوبت شما با {doctor} در تاریخ {date} ساعت {time} ثبت و تأیید شد.'], 'doctor_appointment' => ['{"date":"token","time":"token2","patient":"token10"}', null], 'welcome' => ['{"name":"token","site":"token10"}', null], ]; public function getDescription(): string { return 'token_map پیامک‌ها: تضمین وجود %token در payment/doctor_appointment/welcome'; } public function up(Schema $schema): void { foreach (self::FIX as $tag => [$map, $body]) { if ($body !== null) { $this->addSql( 'UPDATE sms_message_templates SET token_map = :map, body = :body WHERE tag = :tag', ['map' => $map, 'body' => $body, 'tag' => $tag] ); } else { $this->addSql( 'UPDATE sms_message_templates SET token_map = :map WHERE tag = :tag', ['map' => $map, 'tag' => $tag] ); } } } public function down(Schema $schema): void { $this->addSql("UPDATE sms_message_templates SET token_map = '{\"doctor\":\"token10\",\"date\":\"token20\"}', body = 'نوبت شما با {doctor} در تاریخ {date} ثبت و تأیید شد.' WHERE tag = 'payment'"); $this->addSql("UPDATE sms_message_templates SET token_map = '{\"patient\":\"token10\",\"date\":\"token2\",\"time\":\"token3\"}' WHERE tag = 'doctor_appointment'"); $this->addSql("UPDATE sms_message_templates SET token_map = '{\"name\":\"token10\",\"site\":\"token20\"}' WHERE tag = 'welcome'"); } }