Ken hai 5 días
pai
achega
45ea5e31f2
Modificáronse 1 ficheiros con 8 adicións e 6 borrados
  1. 8 6
      app/Http/Controllers/api/Home.php

+ 8 - 6
app/Http/Controllers/api/Home.php

@@ -91,16 +91,18 @@ class Home extends Controller
 //            'message_id' => $topMessage->getMessageId(),
 //        ]);
 
-
-        $telegram->sendMessage([
-            'chat_id' => "7860483406",
-            'text' => '
-    <table>
+$text = <<<EOF
+<table>
         <tr><th>姓名</th><th>年龄</th></tr>
         <tr><td>小明</td><td>18</td></tr>
         <tr><td>小红</td><td>20</td></tr>
     </table>
-    ',
+EOF;
+
+
+        $telegram->sendMessage([
+            'chat_id' => "7860483406",
+            'text' => $text,
             'parse_mode' => 'HTML'
         ]);