本文整理汇总了PHP中app\Country::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::lists方法的具体用法?PHP Country::lists怎么用?PHP Country::lists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Country
的用法示例。
在下文中一共展示了Country::lists方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRegistertab
public function getRegistertab()
{
$country = [];
$country += ['' => '-- Selecciona Pais --'];
$country += Country::lists('name', 'id')->toArray();
$challenge = ChallengeController::getlist();
$degree = DegreeController::getlist();
return view('tab', compact('country', 'challenge', 'degree'));
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(User $user)
{
if ($user->cannot('edit', $user)) {
return redirect('users');
}
//if(Gate::denies('edit', $user)) return redirect('users');//??
$roles = \App\Role::lists('role', 'id');
$countries = \App\Country::lists('name', 'id');
return view('users.edit', compact('user', 'roles', 'countries'));
}
示例3: run
public function run()
{
$uploads = public_path('images/uploads');
$filesObj = \Symfony\Component\Finder\Finder::create()->files()->in($uploads);
$files = [];
foreach ($filesObj as $file) {
$files[] = $file->getFilename();
}
$countries = \App\Country::lists('id');
$faker = Faker\Factory::create();
for ($i = 0; $i < 20; $i++) {
$image = $faker->optional()->randomElement($files);
\App\Contact::create(['firstName' => $faker->firstName, 'lastName' => $faker->lastName, 'birthday' => $faker->dateTimeThisCentury, 'phone' => $faker->phoneNumber, 'address' => $faker->address, 'country_id' => $faker->optional()->randomElement($countries), 'comment' => $faker->paragraph(5), 'photo' => is_null($image) ? $image : 'images/uploads/' . $image, 'height' => $faker->randomNumber(2, true) + 100]);
}
}
示例4: edit
/**
* 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);
}
示例5: getRegister
public function getRegister()
{
return view('auth.register', ['countries' => Country::lists('name', 'id')]);
}
示例6: getRegister
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
public function getRegister()
{
$countries = Country::lists('name', 'id');
return view('auth.register', compact('countries'));
}
示例7: getIndex
public function getIndex()
{
return view('job.index')->with('countries', Country::lists('name', 'id'))->with('educationalqualifications', Educationalqualification::lists('name', 'id'))->with('joblevels', Joblevel::lists('name', 'id'))->with('industries', Industry::lists('name', 'id'))->with('jobtypes', Jobtype::lists('name', 'id'))->with('jobcategories', Jobcategory::lists('name', 'id'))->with('level', 0);
}
示例8: edit
/**
* 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);
}
示例9: edit
/**
* 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);
}
示例10: update
public function update(Request $request)
{
$data = Tool::removeSpace($request->all());
if ($data['id']) {
} else {
$ins = new Institution();
$ins->name = $data['nombre'];
$ins->user_id = 1;
if (isset($data['Tipo'][0])) {
$r = $this->returnType($data['Tipo'][0]);
$ins->{$r} = true;
}
if (isset($data['Tipo'][1])) {
$r = $this->returnType($data['Tipo'][1]);
$ins->{$r} = true;
}
if (isset($data['Tipo'][2])) {
$r = $this->returnType($data['Tipo'][2]);
$ins->{$r} = true;
}
$ins->country_id = $data['País'];
$ins->state_id = $data['Estado'];
$ins->city_id = $data['Ciudad'];
$ins->save();
$country = [];
$country += ['' => '-- Selecciona Pais --'];
$country += Country::lists('name', 'id')->toArray();
$insti = $this->pagination();
return view('institutions.index', compact('insti', 'country'));
}
}