Skip to content

Commit 6fe614f

Browse files
authored
Update ApiMakeCommand.php
1 parent 65c3691 commit 6fe614f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Generator/ApiMakeCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ApiMakeCommand extends Command
3030
{--C|resource : create a resource}
3131
{--P|policy : create a policy}
3232
{--R|request : create a request}
33+
{--T|test : create a Feature Test}
3334
{--A|all : create all requirements}';
3435

3536
/**
@@ -95,7 +96,7 @@ protected function createOptionals()
9596
}
9697

9798
if ($this->option('all') || $this->option('policy')) {
98-
$this->call('make:policy', ['name' => $this->stubVariables['model']['name'].'Policy', '--model' => $this->stubVariables['model']['fullNameWithoutRoot']]);
99+
$this->call('make:policy', ['name' => $this->stubVariables['model']['fullNameWithoutRoot'].'Policy', '--model' => $this->stubVariables['model']['fullNameWithoutRoot']]);
99100
}
100101

101102
if ($this->option('all') || $this->option('resource')) {
@@ -106,6 +107,10 @@ protected function createOptionals()
106107
if ($this->option('all') || $this->option('request')) {
107108
$this->call('make:request', ['name' => $this->stubVariables['model']['name']. 'Request']);
108109
}
110+
111+
if ($this->option('all') || $this->option('test')) {
112+
$this->call('make:test', ['name' => $this->stubVariables['model']['fullNameWithoutRoot']. 'Test']);
113+
}
109114
}
110115

111116

0 commit comments

Comments
 (0)