mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
fix seeding for testing
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Deliveryinfo::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => $faker,
|
||||
'branch' => $faker->text,
|
||||
'deli_info' => $faker->sentence,
|
||||
'address' => $faker->text,
|
||||
'city' => $faker->text,
|
||||
'postcode' => $faker->text,
|
||||
'state' => $faker->text,
|
||||
'country' => $faker->text,
|
||||
'contact_person' => $faker->name,
|
||||
'contact_person_no' => $faker->text,
|
||||
];
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CompanySeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('companies')->insert([
|
||||
|
||||
'id' => '999',
|
||||
'company_name'=>'testing',
|
||||
'registration_no'=>'testing',
|
||||
'tax_no'=>'testing',
|
||||
'tel_no'=>'12345',
|
||||
'fax'=>'12345',
|
||||
'address'=>'testing',
|
||||
'city'=>'testing',
|
||||
'postcode'=>'12345',
|
||||
'state'=>'testing',
|
||||
'country'=>'testing',
|
||||
'contact_person'=>'testing',
|
||||
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
'user_id' => '2'
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -13,5 +13,7 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
$this->call(LaratrustSeeder::class);
|
||||
$this->call(UsersTableSeeder::class);
|
||||
$this->call(DeliveryInfoSeeder::class);
|
||||
$this->call(CompanySeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class DeliveryInfoSeeder extends Seeder
|
||||
{
|
||||
@@ -11,6 +12,22 @@ class DeliveryInfoSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
DB::table('deliveryinfos')->insert([
|
||||
|
||||
'id' => '999',
|
||||
'branch' => 'Testing',
|
||||
'deli_info' => 'Testing',
|
||||
'address' => 'Testing',
|
||||
'city' => 'Test',
|
||||
'postcode' => '12345',
|
||||
'state' => 'Testing',
|
||||
'country' => 'Testing',
|
||||
'contact_person' => 'Testing',
|
||||
'contact_person_no' => '12345',
|
||||
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
'com_id' => '999'
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user