/** * Run the database seeds. * * @return void */ public function run() { DB::table('blood_groups')->truncate(); $blood_group_A = BloodGroup::create(array('blood_group' => 'A')); $blood_group_B = BloodGroup::create(array('blood_group' => 'B')); $blood_group_AB = BloodGroup::create(array('blood_group' => 'AB')); $blood_group_O = BloodGroup::create(array('blood_group' => 'O')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $data['student'] = Student::find($id); $data['title'] = 'Edit ' . $data['student']->fname; $data['students_menu'] = 1; $data['gender'] = Gender::lists('gender', 'id')->prepend('Please Select'); $data['bloodGroups'] = BloodGroup::lists('blood_group', 'id')->prepend('Please Select'); $data['locals'] = Local::lists('local_name', 'id')->prepend('Please Select'); $data['states'] = State::lists('name', 'id')->prepend('Please Select'); $data['countries'] = Country::lists('name', 'id')->prepend('Please Select'); $data['parents'] = StudentParent::select(\DB::raw('concat (fname," ",lname) as full_name, id'))->lists('full_name', 'id')->prepend('Please Select'); $data['classes'] = StudentClass::lists('name', 'id')->prepend('Please Select'); $data['religions'] = Religion::lists('religion', 'id')->prepend('Please Select'); return view('admin.students.edit', $data); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $data['parent'] = StudentParent::find($id); $data['parents_menu'] = 1; $data['title'] = 'Edit Parent'; $data['gender'] = Gender::lists('gender', 'id')->prepend('Please Select'); $data['bloodGroups'] = BloodGroup::lists('blood_group', 'id')->prepend('Please Select'); $data['locals'] = Local::lists('local_name', 'id')->prepend('Please Select'); $data['states'] = State::lists('name', 'id')->prepend('Please Select'); $data['countries'] = Country::lists('name', 'id')->prepend('Please Select'); $data['religions'] = Religion::lists('religion', 'id')->prepend('Please Select'); return view('admin.parents.edit', $data); }