Exemplo n.º 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']);
 }
Exemplo n.º 2
0
 /**
  * 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']);
 }