fix conflict, fix marhun harga, add faker in gadai and fix composer
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
class GadaiFactory
|
||||
{
|
||||
protected $faker;
|
||||
|
||||
public function __construct(Faker $faker)
|
||||
{
|
||||
$this->faker = $faker;
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
static $number = 1;
|
||||
|
||||
return [
|
||||
'kodcaw' => 'KB2',
|
||||
'norujukan' => ($number > 9) ? 'KB2231123-00' . $number : 'KB2231123-000' . $number ,
|
||||
'nopelanggan' => 'M03-00009968',
|
||||
'nokp' => '630411035213',
|
||||
't_gadai' => '2023-11-23',
|
||||
'masa' => '13:46:57',
|
||||
'sirig' => $number++,
|
||||
'nilaimarhun' => 3000.09,
|
||||
'berat' => 10.17,
|
||||
'pinjaman' => 2300,
|
||||
'telahbayar' => 0.00,
|
||||
'upahtelahbyr' => 0.00,
|
||||
'cajtelahbyr' => null,
|
||||
'ansuran' => null,
|
||||
'ansupah' => null,
|
||||
'kadarupah' => null,
|
||||
'tempoh' => 0.5,
|
||||
't_lelong' => null,
|
||||
't_hapus' => null,
|
||||
'sttebus' => '',
|
||||
'terima' => 1,
|
||||
'cetak' => 1,
|
||||
'tncek' => null,
|
||||
'nocek' => null,
|
||||
'bkcode' => null,
|
||||
'teller' => 'NORLY BINTI DERAMAN',
|
||||
'pelulus' => null,
|
||||
'cancelid' => null,
|
||||
'canceltime' => null,
|
||||
'f_lulus' => null,
|
||||
'tag' => null,
|
||||
'jbg' => 0.5,
|
||||
'bakipjm' => 2300,
|
||||
'bakiupah' => 39.1,
|
||||
'upahdibayar' => 0.00,
|
||||
'marhun' => '1 R/L,',
|
||||
'taglel' => null,
|
||||
't_update' => '2023-11-23',
|
||||
't_matang' => '2024-06-24',
|
||||
't_matang1' => '2024-06-24',
|
||||
'penilai' => 'MOHD KHALID ABDUL RAHMAN',
|
||||
'tagserah' => 1,
|
||||
'namapelulus' => '',
|
||||
'percentpinj' => 80,
|
||||
'namateller' => 'NORLY BINTI DERAMAN',
|
||||
'jumtebus' => 0.00,
|
||||
'upahnotis' => 0.00,
|
||||
'tagpalsu' => 0,
|
||||
'historygadaian' => '',
|
||||
'tagcetak' => 1,
|
||||
'lel1stop' => 0,
|
||||
'tebus' => null,
|
||||
'bakihargajualan' => 2769.2,
|
||||
'hargajualan' => 2769.2,
|
||||
'upah12' => 120,
|
||||
'tagkomuditi' => 0,
|
||||
'tempohbayar' => 0,
|
||||
'lelong_tawarruq' => 0,
|
||||
'semakbarcode' => 'Lulus'
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
class MarhunFactory
|
||||
{
|
||||
protected $faker;
|
||||
|
||||
public function __construct(Faker $faker)
|
||||
{
|
||||
$this->faker = $faker;
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
static $number = 1;
|
||||
|
||||
return [
|
||||
'kodcaw' => 'KB2',
|
||||
'marhun' => 'R/L',
|
||||
't_gadai' => '2023-11-23',
|
||||
'norujukan' => ($number > 9) ? 'KB2231123-00' . $number : 'KB2231123-000' . $number ,
|
||||
'bil' => 1,
|
||||
'nota' => $number++,
|
||||
'karat' => '24.0K',
|
||||
'berat' => 10.17,
|
||||
'harga' => 295.11,
|
||||
'n_marhun' => 3000.09
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Faker\Factory as FakerFactory;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class GadaiSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$faker = FakerFactory::create();
|
||||
$gadaiFactory = new GadaiFactory($faker);
|
||||
|
||||
// Create 10 instances of Gadai
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
DB::connection('mysql')->table('gadai')->insert($gadaiFactory->create());
|
||||
DB::connection('mysql')->table('marhun')->insert($gadaiFactory->create());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user