public function __invoke(array $input) { $this->stories = new \stories($this->shiftModel, $this->userModel, $this->tokensModel, $this->token); if (!empty($input['shiftID'] && !empty($input['employeeID']))) { $shiftID = $input['shiftID']; $employeeID = $input['shiftID']; $success = $this->stories->assignEmployeetoShift($employeeID, $shiftID); } else { throw new \Exception('improper API usage'); } return (new Payload())->withStatus(Payload::OK)->withOutput(['result' => $success]); }