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

42 lines
785 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Seed;
class scraperAddSeed extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'scraper:add-seed {regionId} {uri}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Add new seed to database.';
/**
* 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);
}
}