public function run() { // DB::table('gender')->delete(); DB::table('gender')->truncate(); $male = Gender::create(array('gender' => 'Male')); $female = Gender::create(array('gender' => 'Female')); }
/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); $genders = array(['gender_type' => 'male'], ['gender_type' => 'female']); foreach ($genders as $gender) { Gender::create($gender); } }
private function getGenders() { $genders_rs = Gender::orderBy('name', 'asc')->get(); $genders = [0 => 'Choose a gender']; foreach ($genders_rs as $g) { $genders[$g->id] = $g->name; } return $genders; }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Director $director) { // Edit an exisiting director $brands = Brand::lists('short_name', 'id'); $statuses = Status::lists('name', 'id'); $genders = Gender::lists('name', 'id'); $titles = Title::lists('name', 'id'); return view('directors.edit', compact('director', 'brands', 'statuses', 'users', 'titles', 'genders')); }
public function getListByGender($slug) { $currentMC = collect(); $currentMC->name = \App\Gender::getGenderBySlug($slug)[0]->gender; $currentMC->fonticon = ""; $projects = \App\Project::getProjectsByGender($slug); //dump($currentMC); return view('cosplaydesign.pages.lista', compact("projects", "currentMC")); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Lead $lead) { // Edit an exisiting lead $stages = Stage::lists('name', 'id'); $sources = Source::lists('name', 'id'); $genders = Gender::lists('name', 'id'); $titles = Title::lists('name', 'id'); $users = User::lists('name', 'id'); return view('leads.edit', compact('lead', 'stages', 'sources', 'users', 'titles', 'genders')); }
/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker\Factory::create('it_IT'); $projectsID = $this->getProjectIdsArray(); $genders = array('anime', 'manga', 'videogames', 'films', 'telefilms', 'serie tv', 'altro'); foreach ($genders as $gender) { $slug = Str::slug($gender); $_gender = Gender::create(['gender' => $gender, 'slug' => $slug, 'active' => 1]); $_gender->projects()->sync($faker->randomElements($projectsID, mt_rand(1, 1))); } }
public function show($id) { $gender = Gender::find($id); //return $gender; if (count($gender) > 0) { $statusCode = 200; $response = ['id' => $gender->id, 'Gender' => $gender->gender]; } else { $response = ["error" => "Gender doesn`t exist"]; $statusCode = 404; } return response($response, $statusCode)->header('Content-Type', 'application/json'); }
public function run() { DB::table('gender')->delete(); Gender::create(['id' => '1', 'gender' => 'Male']); Gender::create(['id' => '2', 'gender' => 'Female']); }
public static function getProjectsByGender($slug) { $gender = \App\Gender::getGenderBySlug($slug)[0]->id; return \App\Gender::find($gender)->projects; }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit() { // $gender = Gender::lists('gender', 'id'); $age = Age::lists('age', 'id'); $occupation = Occupation::lists('occupation', 'id'); $country = Country::orderBy('country')->lists('country', 'id'); //for alphabetic order $education = Education::lists('education', 'id'); //return Auth::User()->profile; return view('user.edit', compact('gender', 'age', 'occupation', 'country', 'education')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $data['title'] = 'Edit Staff'; $data['staff'] = Staff::find($id); $data['staff_menu'] = 1; $data['gender'] = Gender::lists('gender', 'id')->prepend('Please Select'); $data['countries'] = Country::lists('name', 'id')->prepend('Please Select'); $data['states'] = State::lists('name', 'id')->prepend('Please Select'); $data['locals'] = Local::lists('local_name', 'id')->prepend('Please Select'); $data['staff_types'] = StaffType::lists('staff_type', 'id')->prepend('Please Select'); return view('admin.staff.edit', $data); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $genders = Gender::lists('gender_name', 'id')->all(); $category = Category::find($id); return view('admin.categories.edit', compact('category', 'genders')); }
*/ Route::get('records', 'RecordController@index'); Route::resource('record', 'RecordController'); /** * Display All Users */ Route::get('/users', function () { // Roles $roles_rs = Role::orderBy('name', 'asc')->get(); $roles = []; $roles[0] = 'Choose a roles'; foreach ($roles_rs as $r) { $roles[$r->id] = $r->name; } // Genders $genders_rs = Gender::orderBy('name', 'asc')->get(); $genders = []; $genders[0] = 'Choose a gender'; foreach ($genders_rs as $g) { $genders[$g->id] = $g->name; } // Clubs $clubs_rs = Club::orderBy('name', 'asc')->get(); $clubs = []; $clubs[0] = 'Choose a club'; foreach ($clubs_rs as $c) { $clubs[$c->id] = $c->name; } $users = User::orderBy('created_at', 'asc')->get(); return view('users', ['title' => 'Users', 'clubs' => $clubs, 'genders' => $genders, 'roles' => $roles, 'users' => $users]); });
public static function getProjectsByGender($gender) { $baseProjects = \App\Gender::getProjectsByGender($gender); $projectsComplete = collect(); foreach ($baseProjects as $project) { $progetto = \App\Project::getFullProjectData($project->id); $projectsComplete->push($progetto); } return $projectsComplete; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Gender $gender) { // Delete $gender $gender->delete(); flash()->success('Gender has been deleted'); return redirect('genders'); }
/** * 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); }
public function index() { $gender = Gender::all()->toArray(); return $gender; }
/** * 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); }
public function getById($id) { $gender = Gender::with('translations')->find($id); return $gender; }