public function borrarDelegado()
 {
     $socio_id = Input::get("socio_id");
     $club_id = Input::get("club_id");
     $delegado = Delegado::where("club_id", $club_id)->where("socio_id", $socio_id)->first();
     if ($delegado != null) {
         if ($delegado->delete()) {
             return response()->json(['result' => 'Ok', 'response' => $delegado]);
         }
     }
     return Response::json(['result' => "Error"], 201);
     //
 }
Exemple #2
0
 public function getDelegadosAttribute()
 {
     $plantilla = Delegado::with('socio')->where('club_id', $this->id)->get();
     return $plantilla;
 }