Skip to content

Commit 559498f

Browse files
Edit command
1 parent c761fcd commit 559498f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Console/GenerateApiResourceCommand.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Illuminate\Filesystem\Filesystem;
1313
use Illuminate\Support\Str;
1414
use ReflectionClass;
15+
use Symfony\Component\Console\Input\InputArgument;
1516

1617
class GenerateApiResourceCommand extends Command
1718
{
@@ -60,6 +61,7 @@ public function __construct(Filesystem $files)
6061
/**
6162
* @throws BindingResolutionException
6263
* @throws \Doctrine\DBAL\Exception
64+
* @throws FileNotFoundException
6365
*/
6466
public function handle(): void
6567
{
@@ -73,6 +75,13 @@ public function handle(): void
7375
$this->generateResource($model);
7476
}
7577

78+
protected function getArguments(): array
79+
{
80+
return [
81+
['model', InputArgument::REQUIRED, 'The model class name.'],
82+
];
83+
}
84+
7685
protected function defaultResourcesDir(): string
7786
{
7887
return 'app/Http/Resources';

0 commit comments

Comments
 (0)