mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 20:44:19 +00:00
41 lines
875 B
PHP
41 lines
875 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
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);
|
|
}
|
|
|
|
}
|
|
}
|