/**
  * Display a listing of the resource.
  *
  * @param Organization $org
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //dd($org->gyms()->get());
     //return 'gym index';
     $gyms = Gym::all();
     return view('gyms/index')->with(['gyms' => $gyms]);
 }
 /**
  * Show the form for editing the specified Contracts.
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $contracts = $this->contractsRepository->find($id);
     if (empty($contracts)) {
         Flash::error('Contracts not found');
         return redirect(route('contracts.index'));
     }
     $users = \DB::table('users')->lists('email', 'id');
     $contracttypes = \DB::table('contracttypes')->lists('type', 'id');
     $outlinesports = \DB::table('outlinesports')->lists('sport', 'id');
     $naturezas = \DB::table('naturezas')->lists('natureza', 'id');
     $profitcenters = \DB::table('profitcenters')->lists('profitcenter', 'id');
     $taxationtypes = \DB::table('taxationtypes')->lists('type', 'id');
     $gyms = \App\Gym::all();
     $gymb = \DB::table('contract_gym')->where('contract_id', $id)->get(['gym_id']);
     $catracas = \App\Catraca::all();
     $catracab = \DB::table('catraca_contract')->where('contract_id', $id)->get(['catraca_id']);
     $turmas = \App\Turma::all();
     $turmab = \DB::table('contract_turma')->where('contract_id', $id)->get(['turma_id']);
     return view('contracts.edit')->with('contracts', $contracts)->with('users', $users)->with('contracttypes', $contracttypes)->with('outlinesports', $outlinesports)->with('naturezas', $naturezas)->with('profitcenters', $profitcenters)->with('taxationtypes', $taxationtypes)->with('gyms', $gyms)->with('catracas', $catracas)->with('turmas', $turmas)->with('gymb', $gymb)->with('catracab', $catracab)->with('turmab', $turmab);
 }
 /**
  * Show the form for editing the specified Services.
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $services = $this->servicesRepository->find($id);
     if (empty($services)) {
         Flash::error('Services not found');
         return redirect(route('services.index'));
     }
     $users = \DB::table('users')->lists('email', 'id');
     $naturezas = \DB::table('naturezas')->lists('natureza', 'id');
     $profitcenters = \DB::table('profitcenters')->lists('profitcenter', 'id');
     $taxationtypes = \DB::table('taxationtypes')->lists('type', 'id');
     $gyms = \App\Gym::all();
     $gymb = \DB::table('gym_service')->where('service_id', $id)->get(['gym_id']);
     return view('services.edit')->with('services', $services)->with('users', $users)->with('naturezas', $naturezas)->with('profitcenters', $profitcenters)->with('taxationtypes', $taxationtypes)->with('gyms', $gyms)->with('gymb', $gymb);
 }