public function pass(Request $request)
 {
     $steps = Step::pluck('name', 'id')->toArray();
     $periods = Period::pluck('name', 'id')->toArray();
     $current_period = Period::current()->first();
     $registration_count = Registration::orderBy('id', 'desc');
     $registration_gender = Registration::groupBy('gender');
     $registration_specialty = Registration::groupBy('academystructure_specialty_id');
     $registration_country = Registration::groupBy('contact_country_id');
     $registration_step = Registration::groupBy('registration_step_id');
     if (request('step_id')) {
         $registration_count->whereHas('histories', function ($query) {
             $query->where('registration_step_id', '=', request('step_id'));
         });
         $registration_gender->whereHas('histories', function ($query) {
             $query->where('registration_step_id', '=', request('step_id'));
         });
         $registration_specialty->whereHas('histories', function ($query) {
             $query->where('registration_step_id', '=', request('step_id'));
         });
         $registration_country->whereHas('histories', function ($query) {
             $query->where('registration_step_id', '=', request('step_id'));
         });
         $registration_step->whereHas('histories', function ($query) {
             $query->where('registration_step_id', '=', request('step_id'));
         });
     }
     if (request('period_id')) {
         $registration_count->where('registration_period_id', request('period_id'));
         $registration_gender->where('registration_period_id', request('period_id'));
         $registration_specialty->where('registration_period_id', request('period_id'));
         $registration_country->where('registration_period_id', request('period_id'));
         $registration_step->where('registration_period_id', request('period_id'));
     }
     $registration_count = $registration_count->count();
     $registration_gender = $registration_gender->select('gender', DB::raw('count(*) as total'))->orderBy('total', 'desc')->get()->toArray();
     $registration_specialty = $registration_specialty->select('academystructure_specialty_id as specialty', DB::raw('count(*) as total'))->orderBy('total', 'desc')->get()->toArray();
     $registration_country = $registration_country->select('contact_country_id as country', DB::raw('count(*) as total'))->orderBy('total', 'desc')->get()->toArray();
     $registration_step = $registration_step->select('registration_step_id as step', DB::raw('count(*) as total'))->orderBy('total', 'desc')->get()->toArray();
     $steps = Step::pluck('name', 'id')->toArray();
     $periods = Period::pluck('name', 'id')->toArray();
     $current_period = Period::current()->first();
     $specialties = Specialty::pluck('name', 'id')->toArray();
     $countries = Country::pluck('name', 'id')->toArray();
     return view('registration::reports.pass', compact('steps', 'periods', 'current_period', 'specialties', 'countries', 'registration_gender', 'registration_specialty', 'registration_country', 'registration_step', 'registration_count'));
 }