public function __invoke(array $input)
 {
     if (!$this->auth->authorizeEndpoint('UpdateShift')) {
         return $this->auth->errorPayload;
     }
     // wow, PHP doesn't automatically parse incoming data if it's a PUT...
     // ideally $input should contain the parsed data
     // leaving this hack here for now
     parse_str(file_get_contents("php://input"), $input);
     $shift = Shift::findOrFail($input['id']);
     $updated_fields = array_merge($shift->toArray(), $input);
     if ($shift->validate($updated_fields)) {
         $shift->fill($updated_fields);
         $shift->save();
     } else {
         return (new Payload())->withStatus(Payload::INVALID)->withOutput(['error' => 'Missing required fields.']);
     }
     return (new Payload())->withStatus(Payload::OK)->withOutput($shift->toArray());
 }