43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use App\Libraries\UuidHelper;
|
|
use Faker\Factory as Faker;
|
|
|
|
class TopUpTableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
DB::table('top_up')->truncate();
|
|
|
|
|
|
|
|
for ($i=1; $i < 100; $i++) {
|
|
$uuid = new UuidHelper;
|
|
$faker = Faker::create();
|
|
$uuid = $uuid->generate_uuid1();
|
|
$dataTopUp = array(
|
|
array(
|
|
"topup_uuid" => $uuid,
|
|
"fee_code" => str_pad($i, 4, '0', STR_PAD_LEFT),
|
|
"name" => $faker->colorName,
|
|
"amount" => $faker->randomNumber(3),
|
|
"is_active" => rand(0,1),
|
|
"type" => rand(1,2), //1 PH peso 2 Percentage
|
|
"created_by" => 1,
|
|
"created_at" => date("Y-m-d H:i:s"),
|
|
)
|
|
);
|
|
DB::table('top_up')->insert($dataTopUp);
|
|
}
|
|
|
|
|
|
}
|
|
}
|