added company, warehouse, contact seeder

This commit is contained in:
Zain Fauzan Rofie Azizi
2018-07-02 15:24:32 +08:00
parent e866d7eb0d
commit 8eebdcd093
8 changed files with 85 additions and 20 deletions
+18 -1
View File
@@ -7,8 +7,25 @@ use Illuminate\Database\Eloquent\Model;
class Company extends Model class Company extends Model
{ {
protected $fillable = ['user_id', 'company_profile', 'reg_cert', 'company_name', 'registration_no', 'tax_no', 'tel_no', 'fax', 'address', 'city', 'postcode', 'state', 'country', 'contact_person']; protected $fillable = [
'company_profile',
'reg_cert',
'company_name',
'registration_no',
'tax_no',
'tel_no',
'fax',
'address',
'city',
'postcode',
'state',
'country',
'contact_person',
'user_id',
];
public function user() public function user()
{ {
return $this->belongsTo('App\User'); return $this->belongsTo('App\User');
+6 -6
View File
@@ -6,8 +6,8 @@ use Illuminate\Database\Eloquent\Model;
class Deliveryinfo extends Model class Deliveryinfo extends Model
{ {
protected $fillable = [ protected $fillable = [
'id',
'branch', 'branch',
'deli_info', 'deli_info',
'address', 'address',
@@ -20,10 +20,10 @@ class Deliveryinfo extends Model
'com_id' 'com_id'
]; ];
public function company() { public function company(){
return $this->belongsTo('App\Company'); return $this->belongsTo(App/Company);
} }
} }
+19 -1
View File
@@ -6,6 +6,24 @@ use Illuminate\Database\Eloquent\Model;
class Warehouse extends Model class Warehouse extends Model
{ {
protected $fillable = ['city', 'address','zip','state','contact_person','contact_person_no','branch','country','com_id']; protected $fillable = [
'address',
'city',
'zip',
'state',
'contact_person',
'contact_person_no',
'branch',
'country',
'com_id'
];
public function company(){
return $this->belongsTo(App/Company);
}
} }
+4 -2
View File
@@ -15,9 +15,11 @@ class CompanySeeder extends Seeder
DB::table('companies')->insert([ DB::table('companies')->insert([
'id' => '999', 'id' => '999',
'company_profile'=>'testing',
'reg_cert'=>'12345',
'company_name'=>'testing', 'company_name'=>'testing',
'registration_no'=>'testing', 'registration_no'=>'12345',
'tax_no'=>'testing', 'tax_no'=>'12345',
'tel_no'=>'12345', 'tel_no'=>'12345',
'fax'=>'12345', 'fax'=>'12345',
'address'=>'testing', 'address'=>'testing',
+11 -1
View File
@@ -1,6 +1,7 @@
<?php <?php
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Carbon\Carbon;
class ContactSeeder extends Seeder class ContactSeeder extends Seeder
{ {
@@ -11,6 +12,15 @@ class ContactSeeder extends Seeder
*/ */
public function run() public function run()
{ {
// DB::table('contacts')->insert([
'id' => '999',
'user_id' => '2',
'com_id' => '999',
'status' => '1',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
]);
} }
} }
+3 -1
View File
@@ -13,7 +13,9 @@ class DatabaseSeeder extends Seeder
{ {
$this->call(LaratrustSeeder::class); $this->call(LaratrustSeeder::class);
$this->call(UsersTableSeeder::class); $this->call(UsersTableSeeder::class);
$this->call(DeliveryInfoSeeder::class);
$this->call(CompanySeeder::class); $this->call(CompanySeeder::class);
$this->call(DeliveryInfoSeeder::class);
$this->call(WarehouseSeeder::class);
$this->call(ContactSeeder::class);
} }
} }
+7 -7
View File
@@ -15,14 +15,14 @@ class DeliveryInfoSeeder extends Seeder
DB::table('deliveryinfos')->insert([ DB::table('deliveryinfos')->insert([
'id' => '999', 'id' => '999',
'branch' => 'Testing', 'branch' => 'testing',
'deli_info' => 'Testing', 'deli_info' => 'testing',
'address' => 'Testing', 'address' => 'testing',
'city' => 'Test', 'city' => 'testing',
'postcode' => '12345', 'postcode' => '12345',
'state' => 'Testing', 'state' => 'testing',
'country' => 'Testing', 'country' => 'testing',
'contact_person' => 'Testing', 'contact_person' => 'testing',
'contact_person_no' => '12345', 'contact_person_no' => '12345',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
+17 -1
View File
@@ -1,6 +1,7 @@
<?php <?php
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Carbon\Carbon;
class WarehouseSeeder extends Seeder class WarehouseSeeder extends Seeder
{ {
@@ -11,6 +12,21 @@ class WarehouseSeeder extends Seeder
*/ */
public function run() public function run()
{ {
// DB::table('warehouses')->insert([
'id' => '999',
'address'=>'testing',
'city'=>'testing',
'zip'=>'12345',
'state'=>'testing',
'contact_person'=>'testing',
'contact_person_no'=>'12345',
'branch'=>'testing',
'country'=>'testing',
'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'
]);
} }
} }