/**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $userId = $request->user()->id;
     $roundId = $request->route('rounds');
     if (!$this->round->checkRoundBelongsToUser($userId, $roundId)) {
         abort(403);
     }
     return $next($request);
 }
예제 #2
0
 protected function checkRoundBelongsToUser()
 {
     $userId = $this->user()->id;
     $roundId = $this->route('rounds');
     return $this->round->checkRoundBelongsToUser($userId, $roundId);
 }