public function clockIn() { //makes a new shift $newShift = new Shift(); $uModel = Auth::user(); //sets the user id for the shift $newShift->eid = $uModel->id; //sets the clockin time $now = new DateTime(); $newShift->clockIn = $now->format('Y-m-d H:i:s'); $newShift->save(); //sets the time recorded and clockout time to 0 $newShift->timeRec = 'N/A'; $newShift->clockOut = '0000-00-00 00:00:00'; return $newShift->toJSON(); }