LaravelFreelancerNL /
laravel-index-now
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace LaravelFreelancerNL\LaravelIndexNow\Commands; |
||
| 6 | |||
| 7 | use Illuminate\Console\Command; |
||
| 8 | use LaravelFreelancerNL\LaravelIndexNow\Facades\IndexNow; |
||
| 9 | |||
| 10 | class GenerateKeyCommand extends Command |
||
| 11 | { |
||
| 12 | public $signature = 'index-now:generate-key'; |
||
| 13 | |||
| 14 | public $description = 'Generate the key and key file required for index submissions.'; |
||
| 15 | |||
| 16 | 2 | public function handle(): int |
|
| 17 | { |
||
| 18 | 2 | $key = IndexNow::generateKey(); |
|
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 19 | |||
| 20 | 2 | $this->info('The keyfile was generated. Please add the following key to your .env file:'); |
|
| 21 | 2 | $this->newLine(); |
|
| 22 | 2 | $this->info('INDEXNOW_KEY=' . $key); |
|
| 23 | |||
| 24 | 2 | return self::SUCCESS; |
|
| 25 | } |
||
| 26 | } |
||
| 27 |