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

40 lines
710 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\Regions;
2024-07-01 20:55:25 +02:00
class scraperAddRegion 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-region {name}';
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 region to database.';
2024-06-27 21:38:31 +02:00
/**
* Execute the console command.
*/
public function handle()
{
$name = $this->argument('name');
$region = Regions::create([
'name' => $name
]);
$this->info('New Region created '.$region);
}
}