mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
39 lines
846 B
PHP
39 lines
846 B
PHP
<?php
|
|
|
|
use App\Classes\Modules\Countries\DataTransferObjects\CountryObject;
|
|
use App\Classes\Modules\Countries\Services\CreatesCountry;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class CountriesTableSeeder extends Seeder
|
|
{
|
|
|
|
/** @var CreatesCountry */
|
|
private $createsCountry;
|
|
|
|
/**
|
|
* CountriesTableSeeder constructor.
|
|
* @param CreatesCountry $createsCountry
|
|
*/
|
|
public function __construct(CreatesCountry $createsCountry)
|
|
{
|
|
$this->createsCountry = $createsCountry;
|
|
}
|
|
|
|
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
* @throws \App\Classes\Exceptions\MalformedRequestException
|
|
*/
|
|
public function run()
|
|
{
|
|
|
|
foreach (['my', 'cn'] as $code) {
|
|
$object = new CountryObject(country($code));
|
|
$this->createsCountry->execute($object);
|
|
}
|
|
|
|
}
|
|
}
|