/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create($entity) { $name = $entity; $membershipPeriods = []; $institutionTypes = []; $titles = []; $payModes = []; $titles = Salutation::all(); $modes = PaymentMode::all(); foreach ($modes as $mode) { $payModes[$mode->id] = $mode->name; } if ($entity == 'institution-academic') { $membershipPeriods = MembershipPeriod::getPeriodsByType(1)->get(); $institutionTypes = InstitutionType::getInstitutionTypesById(1)->get(); return view('frontend.register.institution-academic', compact('entity', 'membershipPeriods', 'institutionTypes', 'titles', 'payModes')); } else { if ($entity == 'institution-non-academic') { $membershipPeriods = MembershipPeriod::getPeriodsByType(2)->get(); return view('frontend.register.institution-non-academic', compact('entity', 'membershipPeriods', 'titles', 'payModes')); } else { if ($entity == 'individual-student') { $membershipPeriods = MembershipPeriod::getPeriodsByType(3)->get(); return view('frontend.register.individual-student', compact('entity', 'membershipPeriods', 'titles', 'payModes')); } else { if ($entity == 'individual-professional') { $membershipPeriods = MembershipPeriod::getPeriodsByType(4)->get(); $non_academic = Institution::where('membership_type_id', 2); // taking all the professional institutions return view('frontend.register.individual-professional', compact('entity', 'membershipPeriods', 'titles', 'payModes', 'non_academic')); } } } } }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('salutations')->delete(); Salutation::create(['name' => 'Mr']); Salutation::create(['name' => 'Miss']); Salutation::create(['name' => 'Mrs']); Salutation::create(['name' => 'Dr']); Salutation::create(['name' => 'Prof']); }