Skip to content

Commit

Permalink
return null for a limit if limit is set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Baettig committed Jan 28, 2024
1 parent cf5dcc8 commit 2ab1d0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Models/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ public function getLimitForClassRelation(string $base_class_name, string $relati
->where('restricted_model', $base_class_name)
->where('restricted_relation', $relation)
->first();
if (!$feature) {
return null;
}
if ($feature->limit === 0) {
return null;
}
return $feature?->limit;
}
}

0 comments on commit 2ab1d0e

Please sign in to comment.