ConsultancyProject1_Auslast.../scraper/app/Console/Commands/scraperAddSeed.php

42 lines
785 B
PHP
Raw Normal View History

2024-06-27 21:38:31 +02:00
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Seed;
2024-07-01 20:55:25 +02:00
class scraperAddSeed extends Command
2024-06-27 21:38:31 +02:00
{
/**
* The name and signature of the console command.
*
* @var string
*/
2024-07-01 20:55:25 +02:00
protected $signature = 'scraper:add-seed {regionId} {uri}';
2024-06-27 21:38:31 +02:00
/**
* The console command description.
*
* @var string
*/
2024-07-01 20:55:25 +02:00
protected $description = 'Add new seed to database.';
2024-06-27 21:38:31 +02:00
/**
* Execute the console command.
*/
public function handle()
{
$regionId = $this->argument('regionId');
$uri = $this->argument('uri');
$seed = Seed::create([
'uri' => $uri,
'region_id' => $regionId
]);
$this->info('New Seed created '.$seed);
}
}