mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
added company, warehouse, contact seeder
This commit is contained in:
+18
-1
@@ -7,8 +7,25 @@ use Illuminate\Database\Eloquent\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()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
|
||||
@@ -6,8 +6,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Deliveryinfo extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'id',
|
||||
protected $fillable = [
|
||||
|
||||
'branch',
|
||||
'deli_info',
|
||||
'address',
|
||||
@@ -20,10 +20,10 @@ class Deliveryinfo extends Model
|
||||
'com_id'
|
||||
];
|
||||
|
||||
public function company() {
|
||||
public function company(){
|
||||
|
||||
return $this->belongsTo('App\Company');
|
||||
|
||||
}
|
||||
return $this->belongsTo(App/Company);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-1
@@ -6,6 +6,24 @@ use Illuminate\Database\Eloquent\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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,9 +15,11 @@ class CompanySeeder extends Seeder
|
||||
DB::table('companies')->insert([
|
||||
|
||||
'id' => '999',
|
||||
'company_profile'=>'testing',
|
||||
'reg_cert'=>'12345',
|
||||
'company_name'=>'testing',
|
||||
'registration_no'=>'testing',
|
||||
'tax_no'=>'testing',
|
||||
'registration_no'=>'12345',
|
||||
'tax_no'=>'12345',
|
||||
'tel_no'=>'12345',
|
||||
'fax'=>'12345',
|
||||
'address'=>'testing',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ContactSeeder extends Seeder
|
||||
{
|
||||
@@ -11,6 +12,15 @@ class ContactSeeder extends Seeder
|
||||
*/
|
||||
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'),
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
$this->call(LaratrustSeeder::class);
|
||||
$this->call(UsersTableSeeder::class);
|
||||
$this->call(DeliveryInfoSeeder::class);
|
||||
$this->call(CompanySeeder::class);
|
||||
$this->call(DeliveryInfoSeeder::class);
|
||||
$this->call(WarehouseSeeder::class);
|
||||
$this->call(ContactSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@ class DeliveryInfoSeeder extends Seeder
|
||||
DB::table('deliveryinfos')->insert([
|
||||
|
||||
'id' => '999',
|
||||
'branch' => 'Testing',
|
||||
'deli_info' => 'Testing',
|
||||
'address' => 'Testing',
|
||||
'city' => 'Test',
|
||||
'branch' => 'testing',
|
||||
'deli_info' => 'testing',
|
||||
'address' => 'testing',
|
||||
'city' => 'testing',
|
||||
'postcode' => '12345',
|
||||
'state' => 'Testing',
|
||||
'country' => 'Testing',
|
||||
'contact_person' => 'Testing',
|
||||
'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'),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class WarehouseSeeder extends Seeder
|
||||
{
|
||||
@@ -11,6 +12,21 @@ class WarehouseSeeder extends Seeder
|
||||
*/
|
||||
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'
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user