1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 16:24:29 +00:00
pixelfed/app/ModLog.php

51 lines
762 B
PHP
Raw Normal View History

2020-02-18 07:22:47 +00:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class ModLog extends Model
{
protected $visible = ['id'];
protected $fillable = ['*'];
2020-02-18 07:22:47 +00:00
public function admin()
{
return $this->belongsTo(User::class, 'user_id');
}
public function actionToText()
{
$msg = 'Unknown action';
switch ($this->action) {
2020-02-20 07:41:19 +00:00
case 'admin.user.mail':
$msg = "Sent Message";
2020-02-18 07:22:47 +00:00
break;
case 'admin.user.action.cw.warn':
$msg = "Sent CW reminder";
break;
2020-02-20 07:41:19 +00:00
case 'admin.user.edit':
$msg = "Changed Profile";
break;
case 'admin.user.moderate':
$msg = "Moderation";
break;
case 'admin.user.delete':
$msg = "Deleted Account";
break;
2020-02-18 07:22:47 +00:00
default:
$msg = 'Unknown action';
break;
}
return $msg;
}
}