Skip to content

Commit

Permalink
Found an issue with the Entry Model that was preventing submissions (#14
Browse files Browse the repository at this point in the history
)

* Entry was checking all surveys before accepting the entries for one survey.
  • Loading branch information
jorporte authored May 8, 2021
1 parent eab01e1 commit a931b5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Models/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ public function validateMaxEntryPerUserRequirement()
return;
}

$count = static::where('participant_id', $this->participant_id)->count();
$count = static::where('participant_id', $this->participant_id)
->where('survey_id', $this->survey->id)
->count();

if ($count >= $limit) {
throw new MaxEntriesPerUserLimitExceeded();
Expand Down

0 comments on commit a931b5c

Please sign in to comment.