Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | 7 | public function passes($attribute, $value) |
|
38 | { |
||
39 | 7 | $user = app(UserRepository::class)->getById((int) $value); |
|
40 | 7 | $groupToMatch = $this->group(); |
|
41 | return $this->userRepository->getById($value)->groups()->filter(function(Group $group) use ($groupToMatch) { |
||
42 | 6 | return $group->id() === $groupToMatch->id(); |
|
43 | 7 | })->count() > 0; |
|
44 | } |
||
58 | } |