Beispiel #1
0
 public function deleteGang(Request $request)
 {
     if ($this->auth->user()->rank == 1) {
         abort(403);
     }
     if ($request->isMethod('POST')) {
         $userId = $request->get("userId");
         $groupId = $request->get("groupId");
         $Gang = new Gang();
         $Gang->DelMember($userId, $groupId);
     }
     return response()->json(['status' => 'success']);
 }
 /**
  * Supression d'un joueur dans un gang
  */
 public function deleteGang(Request $request, Guard $auth)
 {
     if ($request->isMethod('POST')) {
         $userId = $request->get("userId");
         $groupId = $request->get("groupId");
         $gang = DB::table('gangs')->where('id', $groupId)->first();
         if ($auth->user()->arma == $gang->owner) {
             $Gang = new Gang();
             $Gang->DelMember($userId, $groupId);
         }
     }
     return response()->json(['status' => 'success']);
 }