Skip to content

Commit

Permalink
limit badge labels
Browse files Browse the repository at this point in the history
  • Loading branch information
orlyapps committed Jan 29, 2022
1 parent dcf2e72 commit 6b687fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Fields/WorkflowBadge.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public function __construct($name, $className)
$this->labels($className::statusLabels());
}

public function limit($limit = 5)
{
foreach ($this->labels as $key => $value) {
$this->labels[$key] = \Str::limit($value, $limit);
}

return $this;
}

/**
* The built-in badge types and their corresponding CSS classes.
*
Expand Down

0 comments on commit 6b687fd

Please sign in to comment.