ExpinBot/.svn/pristine/b5/b58b773314071193c036b526c2d...

23 lines
545 B
Plaintext
Executable File

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\File;
class TgComm extends Model
{
// 显式指定表名
protected $table = 'tg_comm';
protected $guarded = ['id'];
//将所有的指令转换成数组文字档
public static function TgComm2Arr(){
$data = tg_comm::all()->toArray();
$export = '<?php return ' . var_export($data, true) . ';';
Storage::disk('dataconfig')->put('TgComm.php', $export);
}
}