WowPress-Tailwind/theme/wowpress/Models/Log.php

28 lines
595 B
PHP

<?php
namespace WoWPress\Models;
use Wenprise\Eloquent\Model;
use WoWPress\Api\BattleNet;
class Log extends Model
{
protected $table = "wowpress_log";
protected $primaryKey = 'ID';
protected $guarded = ['ID'];
const LOG_DEFAULT = "log.default";
const LOG_LOOT = "log.sks.loot";
const LOG_ROLL = "log.sks.roll";
const LOG_SIGNUP = "log.raid.signup";
public static function write(string $message,string $action = Log::LOG_DEFAULT){
$log = new Log();
$log->message = $message;
$log->action = $action;
$log->save();
}
}