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

29 lines
652 B
PHP
Raw Permalink Normal View History

2024-05-02 23:31:44 +02:00
<?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";
const LOG_COMPLAINT_DELETE = "log.complaint.delete";
2024-05-02 23:31:44 +02:00
public static function write(string $message,string $action = Log::LOG_DEFAULT){
$log = new Log();
$log->message = $message;
$log->action = $action;
$log->save();
}
}