| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | public function handle($request, Closure $next) |
||
| 19 | { |
||
| 20 | $gcode = $request->gcode; |
||
| 21 | $group = Group::where('gcode',$gcode)->first(); |
||
| 22 | $banneds = $group->banneds()->where('removed_at','>',date('Y-m-d H:i:s'))->first(); |
||
| 23 | $user = Auth::user(); |
||
| 24 | if(!empty($banneds) && $user->id != $group->leader->id) { |
||
| 25 | return response()->view('errors.451',[ |
||
| 26 | 'description' => 'This group is currently banned. Please contact the group administrator.' |
||
| 27 | ]); |
||
| 28 | } |
||
| 29 | return $next($request); |
||
| 30 | } |
||
| 32 |