PHP code example of cranux / larakeaimao

1. Go to this page and download the library: Download cranux/larakeaimao library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cranux / larakeaimao example snippets


   /接收消息回掉
   $lovelyCat = Factory::LovelyCat([
       'baseUri'=>'https://wm.pyvue.com/',
       'sRequUrl'=>'api/send',
   ]);
   // 解析本次消息 并将消息复制给类属性
   $parseWechat = $lovelyCat->parseWechat();
   // 回复本次消息
   return $lovelyCat->sendTextMsg('111');
   

   $lovelyCat = Factory::LovelyCat([
               'baseUri'=>'https://wm.pyvue.com/',
               'sRequUrl'=>'api/send',
           ]);
   // 两种设置参数的方法
   // 第一如下
   $lovelyCat->from_wxid = '11232434';
   $lovelyCat->robot_wxid = 'wxaa11';
   // 或者 在方法中直接传入
   return $lovelyCat->sendTextMsg('111','wxaa11','11232434');