RuleGroup.php 498 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * 审计规则分组
  6. */
  7. class RuleGroup extends Model {
  8. protected $table = 'rule_group';
  9. protected $casts = [
  10. 'rules' => 'array',
  11. 'nodes' => 'array'
  12. ];
  13. public function getTypeLabelAttribute(): string {
  14. if($this->attributes['type']){
  15. $type_label = '<span class="badge badge-danger">阻 断</span>';
  16. }else{
  17. $type_label = '<span class="badge badge-primary">放 行</span>';
  18. }
  19. return $type_label;
  20. }
  21. }