ModLog.php 731 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class ModLog extends Model
  5. {
  6. protected $visible = ['id'];
  7. public function admin()
  8. {
  9. return $this->belongsTo(User::class, 'user_id');
  10. }
  11. public function actionToText()
  12. {
  13. $msg = 'Unknown action';
  14. switch ($this->action) {
  15. case 'admin.user.mail':
  16. $msg = "Sent Message";
  17. break;
  18. case 'admin.user.action.cw.warn':
  19. $msg = "Sent CW reminder";
  20. break;
  21. case 'admin.user.edit':
  22. $msg = "Changed Profile";
  23. break;
  24. case 'admin.user.moderate':
  25. $msg = "Moderation";
  26. break;
  27. case 'admin.user.delete':
  28. $msg = "Deleted Account";
  29. break;
  30. default:
  31. $msg = 'Unknown action';
  32. break;
  33. }
  34. return $msg;
  35. }
  36. }