| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function handle($request, Closure $next) |
||
| 19 | { |
||
| 20 | $userCount = User::count(); // get the number of users |
||
| 21 | $userCap = config('linkstack.user_cap'); // get the user cap from the config file |
||
| 22 | |||
| 23 | if (!empty($userCap)) { |
||
| 24 | if ($userCount >= $userCap) { |
||
| 25 | abort(403, 'Maximum number of users reached.'); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | return $next($request); |
||
| 30 | } |
||
| 32 |