1 |
<?php
|
|
2 |
|
|
3 |
namespace Nuwave\Lighthouse\Console; |
|
4 |
|
|
5 |
class ValidatorCommand extends LighthouseGeneratorCommand |
|
6 |
{
|
|
7 |
/**
|
|
8 |
* The name of the console command.
|
|
9 |
*
|
|
10 |
* @var string
|
|
11 |
*/
|
|
12 |
protected $name = 'lighthouse:validator'; |
|
13 |
|
|
14 |
/**
|
|
15 |
* The console command description.
|
|
16 |
*
|
|
17 |
* @var string
|
|
18 |
*/
|
|
19 |
protected $description = 'Create a validator class'; |
|
20 |
|
|
21 |
/**
|
|
22 |
* The type of class being generated.
|
|
23 |
*
|
|
24 |
* @var string
|
|
25 |
*/
|
|
26 |
protected $type = 'Validator'; |
|
27 |
|
|
28 |
protected function namespaceConfigKey(): string |
|
29 |
{
|
|
30 |
return 'validators'; |
|
31 |
}
|
|
32 |
|
|
33 |
/**
|
|
34 |
* Get the stub file for the generator.
|
|
35 |
*/
|
|
36 |
protected function getStub(): string |
|
37 |
{
|
|
38 |
return __DIR__.'/stubs/validator.stub'; |
|
39 |
}
|
|
40 |
}
|
Read our documentation on viewing source code .