Skip to content

Commit 66f1204

Browse files
committed
Make create tag group more compatible with older laravel
1 parent 7195ea2 commit 66f1204

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

src/Console/Commands/GenerateTagGroup.php

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,33 @@
55
use Conner\Tagging\TaggingUtility;
66
use Conner\Tagging\Model\TagGroup;
77
use Illuminate\Console\Command;
8+
use Symfony\Component\Console\Input\InputArgument;
89

910
class GenerateTagGroup extends Command
1011
{
11-
/**
12-
* The name and signature of the console command.
13-
*
14-
* @var string
15-
*/
16-
protected $signature = 'tagging:create-group {group_name}';
17-
18-
/**
19-
* The console command description.
20-
*
21-
* @var string
22-
*/
12+
protected $name = 'tagging:create-group';
13+
14+
protected $signature = 'tagging:create-group {group}';
15+
2316
protected $description = 'Create a laravel tag group';
2417

25-
/**
26-
* Execute the console command.
27-
*
28-
* @return mixed
29-
*/
3018
public function handle()
3119
{
32-
$groupName = $this->argument('group_name');
20+
$groupName = $this->argument('group');
3321

3422
$tagGroup = new TagGroup();
3523
$tagGroup->name = $groupName;
3624
$tagGroup->slug = TaggingUtility::normalize($groupName);
3725

3826
$tagGroup->save();
3927

40-
$this->info('Created tag group: ' . $groupName);
28+
$this->info('Created tag group: '.$groupName);
29+
}
30+
31+
protected function getArguments()
32+
{
33+
return [
34+
['group', InputArgument::REQUIRED, 'Name of the group to create.'],
35+
];
4136
}
4237
}

0 commit comments

Comments
 (0)