Ejemplo n.º 1
0
 public function toggle($goal_id)
 {
     $goal = Goal::where('id', $goal_id)->select('id', 'complete')->first();
     $goal->complete = !$goal->complete;
     return $goal->save() ? Response::json($goal) : Response::json(['message' => 'There was a problem updating the goal.'], 400);
 }