Skip to content

Commit

Permalink
Merge pull request #493 from OpenSynergic/open-review-for-author
Browse files Browse the repository at this point in the history
feat : open review for author
  • Loading branch information
rahmanramsi authored Jan 15, 2025
2 parents 969d3f6 + 7bd669f commit a096496
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 73 deletions.
12 changes: 11 additions & 1 deletion app/Models/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function getModeOptions(): array
];
}

protected function reviewMode(): Attribute
public function reviewMode(): Attribute
{
return Attribute::make(
get: fn () => match ((int) $this->getMeta('review_mode')) {
Expand All @@ -106,6 +106,16 @@ protected function reviewMode(): Attribute
);
}

public function isShowAuthor()
{
return in_array($this->getMeta('review_mode'), [Review::MODE_ANONYMOUS, Review::MODE_OPEN]);
}

public function isOpenReview()
{
return $this->getMeta('review_mode') == Review::MODE_OPEN || $this->getMeta('open_review_for_author');
}

protected function getAllDefaultMeta(): array
{
return [
Expand Down
Loading

0 comments on commit a096496

Please sign in to comment.