NotificationLog.php 414 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * 推送通知日志.
  6. */
  7. class NotificationLog extends Model
  8. {
  9. protected $table = 'notification_log';
  10. protected $guarded = [];
  11. // 通知类型
  12. public function getTypeLabelAttribute(): string
  13. {
  14. return config('common.notification.labels')[$this->attributes['type']] ?? trans('common.status.unknown');
  15. }
  16. }