Skip to content

Commit

Permalink
Add inGroup helper
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Dec 16, 2020
1 parent e53eaee commit 72fb73d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/Customers/Models/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public function setFieldsAttribute($val)
$this->attributes['fields'] = is_string($val) ? $val : json_encode($val);
}

public function inGroup($group)
{
return $this->customerGroups()->where('handle', '=', $group)->exists();
}

public function users()
{
return $this->hasMany(GetCandy::getUserModel());
Expand Down

0 comments on commit 72fb73d

Please sign in to comment.