You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/app/Models/ModLog.php

51 lines
1022 B
PHTML

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ModLog extends Model
{
9 months ago
protected $visible = ['id'];
protected $guarded = [];
9 months ago
public function admin()
{
return $this->belongsTo(User::class, 'user_id');
}
public function actionToText(): string
9 months ago
{
$msg = 'Unknown action';
switch ($this->action) {
case 'admin.user.mail':
$msg = 'Sent Message';
break;
case 'admin.user.action.cw.warn':
$msg = 'Sent CW reminder';
break;
case 'admin.user.edit':
$msg = 'Changed Profile';
break;
case 'admin.user.moderate':
$msg = 'Moderation';
break;
case 'admin.user.delete':
$msg = 'Deleted Account';
break;
default:
$msg = 'Unknown action';
break;
}
return $msg;
}
}