本文整理汇总了PHP中app\Country::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::all方法的具体用法?PHP Country::all怎么用?PHP Country::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Country
的用法示例。
在下文中一共展示了Country::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowBranchProfile
public function ShowBranchProfile($id, $branchid)
{
$update = PartnerBranch::where('id', $branchid)->first();
$countries = Country::all();
$partnerid = Partner::find($id);
return view('deskpad/updatebranch', compact('update', 'partnerid', 'countries'));
}
示例2: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$countries = \App\Country::all();
foreach ($countries as $country) {
echo "DB::table('country')->insert(['cc_fips' => '{$country->cc_fips}','cc_iso' => '{$country->cc_iso}','cc_tld' => '{$country->cc_tld}','country_name' => '{$country->country_name}',]); \n";
}
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$player = Player::find($id);
$seasons = Season::all();
$positions = Position::all();
$countries = Country::all();
return view('admin.players.edit', compact('player', $player, 'seasons', $seasons, 'positions', $positions, 'countries', $countries));
}
示例4: ShowUpdateContacts
public function ShowUpdateContacts($id, $branchid)
{
$updatecontact = PartnerContact::where('id', $branchid)->first();
$countries = Country::all();
$citizenships = Citizenship::all();
$partnertitles = Partnertitle::all();
$partnerid = Partner::find($id);
return view('deskpad/updatecontact', compact('updatecontact', 'partnerid', 'countries', 'citizenships', 'partnertitles'));
}
示例5: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$statusCode = 200;
$response = ['countries' => []];
$countries = Country::all();
foreach ($countries as $country) {
$response['countries'][] = ['id' => $country->id, 'country' => $country->country];
}
return response($response, $statusCode);
}
示例6: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$countries = \App\Country::all()->lists('name', 'id');
$state = \App\State::find($id);
if ($state) {
return view('states.edit', ['state' => $state, 'countries' => $countries]);
}
flash()->error('State does not exist.');
return \Redirect::back();
}
示例7: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$city = City::findOrFail($id);
$country = Country::all();
$language = Language::all();
$languages_cur = $city->language;
foreach ($languages_cur as $language_cur) {
$lang[] = $language_cur['id'];
}
return view('editCity', ['id' => $id, 'city' => $city->city, 'country_cur' => $city->country_id, 'languages_cur' => $lang, 'countries' => $country, 'languages' => $language]);
}
示例8: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$title = 'CONFIG';
$country = Country::all()->sortBy('country');
$designation = Designation::all()->sortBy('designation');
$city = City::all()->sortBy('city');
$state = State::all()->sortBy('state');
$brands = Brands::all()->sortBy('brand');
$models = Models::all()->sortBy('model');
$businessType = BusinessType::all()->sortBy('name');
return view('myConfig.index', compact('title', 'country', 'designation', 'city', 'state', 'brands', 'models', 'businessType'));
}
示例9: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if ($this->option('all')) {
foreach (Country::all() as $country) {
$country->import();
sleep(5);
}
} elseif ($this->argument('country')) {
$country = Country::find($this->argument('country'));
if (count($country)) {
$country->import();
}
}
}
示例10: edit
/**
* Returns a view for editing various details about a specific user
*
* @param $name Node 'name' label to match when editing a user
* @return $this
*/
public function edit($name)
{
$user = User::whereName($name)->first();
$groups = Group::all(['id', 'name']);
$groupList = array();
foreach ($groups as $group) {
$groupList[$group->id] = $group->name;
}
$countries = Country::all(['id', 'name']);
$countryList = array();
foreach ($countries as $country) {
$countryList[$country->id] = $country->name;
}
return view('admin.users.edit', compact('user'))->with('groupList', $groupList)->with('countryList', $countryList);
}
示例11: newArt
public function newArt()
{
$getEra = Era::all();
foreach ($getEra as $Era) {
$eras[$Era->id] = $Era->name;
}
$getStyle = Style::all();
foreach ($getStyle as $Style) {
$styles[$Style->id] = $Style->name;
}
$getCountry = Country::all();
foreach ($getCountry as $Country) {
$countrys[$Country->name] = $Country->name;
}
return view('art.new', compact('styles', 'eras', 'countrys'));
}
示例12: playerCountry
public function playerCountry(Request $request)
{
$this->validate($request, ['country_title' => 'required']);
//dd($request->all());
if ($request->file('ajax-country-flag')) {
// $this->validate($request,['ajax-country-flag'=>'required|image|mimes:jpeg,jpg,png,bmp,gif,svg']);
$file = $request->file('ajax-country-flag');
$path = $this->_country_flag_path;
$name = uniqid() . $file->getClientOriginalName();
$file->move($path, $name);
}
$country = new Country(array('title' => $request->get('country_title'), 'flag_name' => $name, 'flag_path' => $path));
$country->save();
$countries = Country::all();
return response()->json($countries);
}
示例13: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create($company_id)
{
$company = Company::find($company_id);
$countries = Country::all();
foreach ($countries as $ctr) {
$country_names[$ctr->id] = $ctr->name;
}
$cities = City::all();
foreach ($cities as $ct) {
$city_names[$ct->id] = $ct->name;
}
foreach (Language::all() as $lang) {
$langs[$lang->id] = $lang->name;
}
return view('jobs.create', compact('country_names', 'city_names', 'langs', 'company'));
}
示例14: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
try {
$statusCode = 200;
// $response = [
// 'Countries List' => []
// ];
$countries = Country::all();
foreach ($countries as $country) {
//
$response['Country List'][] = ['id' => $country->id, 'Country' => $country->country];
}
// $response=$gender;
} catch (Exception $e) {
$statusCode = 400;
} finally {
return Response::json($response, $statusCode);
}
}
示例15: getAllForDropdown
/**
* Get all titles and return a simple array for dropdown list.
*
*
* @return array $titleArray
*/
public function getAllForDropdown()
{
$countries = Country::all();
return Helper::getDropdownArray($countries);
}