Browse Source

get database

master
Siti Hajar Ibrahim 5 years ago
parent
commit
799c3301d5
1 changed files with 2 additions and 5 deletions
  1. 2
    5
      app/Http/Controllers/Controller.php

+ 2
- 5
app/Http/Controllers/Controller.php View File



public function getDatabase(Request $request) public function getDatabase(Request $request)
{ {
$company = Company::all();
return $company;
$company = Company::where('name', 'Innomapps Sdn Bhd')->first();
$staff = Staff::where('email','dealer@test.my')->first(); $staff = Staff::where('email','dealer@test.my')->first();
$staff->company_id = $company->_id;
$staff->company_id = "5bb2bc66ee0dc2271c6fedf6";
$staff->save(); $staff->save();


$details = StaffDetail::where('_id',$staff->_id)->first(); $details = StaffDetail::where('_id',$staff->_id)->first();
$details->company_id = $company->_id;
$details->company_id = "5bb2bc66ee0dc2271c6fedf6";
$details->save(); $details->save();
} }
} }

Loading…
Cancel
Save