User.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. namespace App\Util\RateLimit;
  3. trait User {
  4. public function isTrustedAccount()
  5. {
  6. return $this->created_at->lt(now()->subDays(60));
  7. }
  8. public function getMaxPostsPerHourAttribute()
  9. {
  10. return 50;
  11. }
  12. public function getMaxPostsPerDayAttribute()
  13. {
  14. return 100;
  15. }
  16. public function getMaxCommentsPerHourAttribute()
  17. {
  18. return 50;
  19. }
  20. public function getMaxCommentsPerDayAttribute()
  21. {
  22. return 500;
  23. }
  24. public function getMaxLikesPerHourAttribute()
  25. {
  26. return 120;
  27. }
  28. public function getMaxLikesPerDayAttribute()
  29. {
  30. return 1000;
  31. }
  32. public function getMaxSharesPerHourAttribute()
  33. {
  34. return 60;
  35. }
  36. public function getMaxSharesPerDayAttribute()
  37. {
  38. return 500;
  39. }
  40. public function getMaxUserBansPerDayAttribute()
  41. {
  42. return 100;
  43. }
  44. public function getMaxInstanceBansPerDayAttribute()
  45. {
  46. return 100;
  47. }
  48. public function getMaxHashtagFollowsPerHourAttribute()
  49. {
  50. return 20;
  51. }
  52. public function getMaxHashtagFollowsPerDayAttribute()
  53. {
  54. return 100;
  55. }
  56. public function getMaxCollectionsPerHourAttribute()
  57. {
  58. return 10;
  59. }
  60. public function getMaxCollectionsPerDayAttribute()
  61. {
  62. return 20;
  63. }
  64. public function getMaxCollectionsPerMonthAttribute()
  65. {
  66. return 100;
  67. }
  68. public function getMaxComposeMediaUpdatesPerHourAttribute()
  69. {
  70. return 100;
  71. }
  72. public function getMaxComposeMediaUpdatesPerDayAttribute()
  73. {
  74. return 1000;
  75. }
  76. public function getMaxComposeMediaUpdatesPerMonthAttribute()
  77. {
  78. return 5000;
  79. }
  80. public function getMaxStoriesPerHourAttribute()
  81. {
  82. return 20;
  83. }
  84. public function getMaxStoriesPerDayAttribute()
  85. {
  86. return 30;
  87. }
  88. public function getMaxStoryDeletePerDayAttribute()
  89. {
  90. return 35;
  91. }
  92. public function getMaxPostEditsPerHourAttribute()
  93. {
  94. return 10;
  95. }
  96. public function getMaxPostEditsPerDayAttribute()
  97. {
  98. return 20;
  99. }
  100. }