/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $this->authorize('show', new Inscription());
     //solo inscripciones del ciclo vigente y si es director
     if (Auth::user()->role === 'director') {
         $inscriptions = Inscription::where(['school_id' => Auth::user()->school_id, 'schoolyear_id' => Schoolyear::orderBy('id', 'DESC')->first()->id])->latest()->get();
     } else {
         $inscriptions = Inscription::where('schoolyear_id', Schoolyear::orderBy('id', 'DESC')->first()->id)->latest()->get();
     }
     //si es admin solo los del ciclo actual
     return view('inscription.index', compact('inscriptions'));
 }