首次提交 Laravel 專案
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user