use MazimezGigapayEmployee;
//#1: updating values using separate methods
$employee = Employee::findById('123'); //finding employee by id
$employee = $employee->updateCountry('SWE'); //updating country
$employee = $employee->updateName("test employee"); //updating name
$employee = $employee->updateEmail("jhone@doe.com"); //updating email
$employee = $employee->updateMetaDate(json_encode([
"data" => "some more data from you system", //updating metadata
]));
$employee = $employee->updateId('12354'); //updating id
return $employee->getJson();
//#2 updating values using save() methods
$employee = Employee::findById('dvsdvsdv'); //finding employee by id
$employee->country = "SWE"; //updating country
$employee->name = "test employee"; //updating name
$employee->email = "jhone@32323doe.com"; //updating email
$employee->metadata = json_encode([
"data" => "some more data from you system", //updating metadata
]);
$employee->save(); //saving the employee object
return $employee->getJson();