database/seeds/barang.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $faker = Faker\Factory::create(); 
		$limit = 9; 
		for ($i = 0; $i <$limit; $i++){
			DB::table('barangs')->insert([ 
			'nama_barang' =>$faker->name,
			'stock' =>$faker->unique()->numberBetween($min = 1000, $max = 9000), 
			'harga' =>$faker->numberBetween($min = 1000, $max = 9000),
			'expired_date' =>$faker->dateTimeAD($max = 'now', $timezone = null),
			'tanggal_produksi' =>$faker->dateTimeAD($max = 'now', $timezone = null),
			]);
		}
    }
public function run ( ) { $ faker = Faker \ Factory :: create ( ) ; $ limit = 9 ; for ( $ i = 0 ; $ i < $ limit ; $ i ++ ) { DB :: table ( 'barangs' ) -> insert ( [ 'nama_barang' => $ faker -> name , 'stock' => $ faker -> unique ( ) -> numberBetween ( $ min = 1000 , $ max = 9000 ) , 'harga' => $ faker -> numberBetween ( $ min = 1000 , $ max = 9000 ) , 'expired_date' => $ faker -> dateTimeAD ( $ max = 'now' , $ timezone = null ) , 'tanggal_produksi' => $ faker -> dateTimeAD ( $ max = 'now' , $ timezone = null ) , ] ) ; } }
Run the database seeds.
Run the database seeds .
//import library //batasan pembuatan data palsu //isi datadi database //email uniquesupaya tidak ada yang sama