Download app/Rules/Team/TeamInviteRule.php from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/pnacorp/magicai/resolve/main/app/Rules/Team/TeamInviteRule.php
- Command line
-
hf download hf://pnacorp/magicai/app/Rules/Team/TeamInviteRule.php
-
curl -L -o TeamInviteRule.php https://huggingface.co/pnacorp/magicai/resolve/main/app/Rules/Team/TeamInviteRule.php
530 Bytes
| namespace App\Rules\Team; | |
| use Closure; | |
| use Illuminate\Contracts\Validation\ValidationRule; | |
| class TeamInviteRule implements ValidationRule | |
| { | |
| public function validate(string $attribute, mixed $value, Closure $fail): void | |
| { | |
| $team = request()->route('team'); | |
| $allow_seats = $team->allow_seats; | |
| $used_seats = $team->members()->count(); | |
| if ($allow_seats <= $used_seats) { | |
| $fail(__('You have reached the maximum number of seats allowed for this team.')); | |
| } | |
| } | |
| } | |