I have the following sql queries in my application.
$defaultGoal = DB::table("goals")
-> where("activitiesID", "=", $this->activityID)
-> where("usersID", "=", $userID)
-> pluck("goal");
$defaultGoalPoints = DB::table("goals")
-> where("activitiesID", "=", $this->activityID)
-> where("usersID", "=", $userID)
-> pluck("goalpoints");
$defaultPoints = DB::table("goals")
-> where("activitiesID", "=", $this->activityID)
-> where("usersID", "=", $userID)
-> pluck("points");
Each query returns an array. Is there a way to do combine all of these queries into one, that will return the same arrays for $defaultPoints, $defaultGoalPoints, and $defaultGoal.