Skip to content

Commit ee154b5

Browse files
committed
expand tag, retag syntax
1 parent b4fb6b0 commit ee154b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Taggable.php

+10
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public function getTagsAttribute()
6565
*/
6666
public function tag($tagNames)
6767
{
68+
if(!is_array($tagNames)) {
69+
$tagNames = func_get_args();
70+
array_shift($tagNames);
71+
}
72+
6873
$tagNames = static::$taggingUtility->makeTagArray($tagNames);
6974

7075
foreach($tagNames as $tagName) {
@@ -139,6 +144,11 @@ public function untag($tagNames=null)
139144
*/
140145
public function retag($tagNames)
141146
{
147+
if(!is_array($tagNames)) {
148+
$tagNames = func_get_args();
149+
array_shift($tagNames);
150+
}
151+
142152
$tagNames = static::$taggingUtility->makeTagArray($tagNames);
143153
$currentTagNames = $this->tagNames();
144154

0 commit comments

Comments
 (0)