当前位置: 首页>>代码示例>>PHP>>正文


PHP Country::all方法代码示例

本文整理汇总了PHP中app\models\Country::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::all方法的具体用法?PHP Country::all怎么用?PHP Country::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Country的用法示例。


在下文中一共展示了Country::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public function show($id)
 {
     $beatmapset = Beatmapset::with('beatmaps.failtimes', 'user')->findOrFail($id);
     $set = json_item($beatmapset, new BeatmapsetTransformer(), ['beatmaps', 'beatmaps.failtimes', 'converts', 'converts.failtimes', 'user', 'description', 'ratings']);
     $countries = json_collection(Country::all(), new CountryTransformer());
     $title = trans('layout.menu.beatmaps._') . ' / ' . $beatmapset->artist . ' - ' . $beatmapset->title;
     return view('beatmapsets.show', compact('set', 'title', 'countries'));
 }
开发者ID:ameliaikeda,项目名称:osu-web,代码行数:8,代码来源:BeatmapsetsController.php

示例2: showAccount

 /**
  * Show the user's account.
  *
  * @return \Illuminate\View\View
  */
 public function showAccount(ApplicationRepository $applicationRepository)
 {
     $countries = array();
     foreach (Country::all() as $country) {
         $countries = array_add($countries, $country->id, $country->name);
     }
     return view('user.account')->with(['applications' => $applicationRepository->getAll(Auth::user()), 'countries' => $countries]);
 }
开发者ID:Teamelite,项目名称:Dashboard,代码行数:13,代码来源:AccountController.php

示例3: getNextTurn

 public function getNextTurn()
 {
     $turnManager = new TurnManager();
     foreach (Country::all() as $country) {
         $turnManager->doTurn($country);
     }
     return 'done!';
 }
开发者ID:JJacobi13,项目名称:jcAiBattle,代码行数:8,代码来源:GameController.php

示例4: showRegister

 /**
  * @return \Illuminate\View\View
  */
 public function showRegister()
 {
     $countries = array();
     foreach (Country::all() as $country) {
         $countries = array_add($countries, $country->id, $country->name);
     }
     return view('auth.register')->with(['countries' => $countries]);
 }
开发者ID:Teamelite,项目名称:Dashboard,代码行数:11,代码来源:AuthController.php

示例5: index

 /**
  * 获取国家列表.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     if ($request->ajax()) {
         return Country::all();
     } else {
         return view('res.country.index');
     }
 }
开发者ID:valleyblvd,项目名称:YueFang-ops-web,代码行数:13,代码来源:CountryController.php

示例6: shippingDetails

 public function shippingDetails()
 {
     $userID = Session::get('loggedinUserId');
     $addresses = Address::where('user_id', '=', $userID)->get();
     $country = Country::all();
     $state = State::all();
     return view(Config('constants.frontendCheckoutView') . '.shipping', compact('country', 'state', 'addresses'));
 }
开发者ID:bhavs123,项目名称:web,代码行数:8,代码来源:CheckoutController.php

示例7: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $faker = Faker\Factory::create();
     $company = Company::create();
     $account = Account::create(['name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => Country::all()->random()->id, 'account_key' => str_random(RANDOM_KEY_LENGTH), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'work_phone' => $faker->phoneNumber, 'work_email' => $faker->safeEmail, 'invoice_design_id' => min(InvoiceDesign::all()->random()->id, 10), 'header_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17), 'primary_color' => $faker->hexcolor, 'timezone_id' => 1, 'company_id' => $company->id]);
     User::create(['email' => TEST_USERNAME, 'username' => TEST_USERNAME, 'account_id' => $account->id, 'password' => Hash::make(TEST_PASSWORD), 'registered' => true, 'confirmed' => true, 'notify_sent' => false, 'notify_paid' => false]);
     Affiliate::create(['affiliate_key' => SELF_HOST_AFFILIATE_KEY]);
 }
开发者ID:medea61,项目名称:invoiceninja,代码行数:10,代码来源:UserTableSeeder.php

示例8: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $faker = Faker\Factory::create();
     $company = Company::create();
     $account = Account::create(['name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => Country::all()->random()->id, 'account_key' => str_random(RANDOM_KEY_LENGTH), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'work_phone' => $faker->phoneNumber, 'work_email' => $faker->safeEmail, 'invoice_design_id' => InvoiceDesign::where('id', '<', CUSTOM_DESIGN)->get()->random()->id, 'header_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17), 'primary_color' => $faker->hexcolor, 'timezone_id' => 1, 'company_id' => $company->id]);
     $user = User::create(['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'email' => TEST_USERNAME, 'username' => TEST_USERNAME, 'account_id' => $account->id, 'password' => Hash::make(TEST_PASSWORD), 'registered' => true, 'confirmed' => true, 'notify_sent' => false, 'notify_paid' => false, 'is_admin' => 1]);
     $client = Client::create(['user_id' => $user->id, 'account_id' => $account->id, 'public_id' => 1, 'name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => DEFAULT_COUNTRY, 'currency_id' => DEFAULT_CURRENCY]);
     Contact::create(['user_id' => $user->id, 'account_id' => $account->id, 'client_id' => $client->id, 'public_id' => 1, 'email' => env('TEST_EMAIL', TEST_USERNAME), 'is_primary' => true]);
     Product::create(['user_id' => $user->id, 'account_id' => $account->id, 'public_id' => 1, 'product_key' => 'ITEM', 'notes' => 'Something nice...', 'cost' => 10]);
     Affiliate::create(['affiliate_key' => SELF_HOST_AFFILIATE_KEY]);
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:13,代码来源:UserTableSeeder.php

示例9: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     if (\Entrust::can('birth-registration-create')) {
         $district = $this->location->getLocationsByLocnType('District');
         //dd($district);
         $handicapTypes = $this->birth->getAllHandicapType();
         $castes = $this->birth->getAllCastes();
         $birthHelpers = $this->birth->getAllBirthHelpers();
         $birthPlaces = $this->birth->getAllBirthPlaces();
         $birthTypes = $this->helper->getBirthTypes();
         $countries = Country::all()->lists('name', 'name');
         return view('birthRegistration.birth_details.add_new')->with('districts', $district)->with('handicapType', $handicapTypes)->with('birthHelpers', $birthHelpers)->with('castes', $castes)->with('birthPlaces', $birthPlaces)->with('birthTypes', $birthTypes)->with('countries', $countries);
     } else {
         return abort(404, 'You are not allowed');
     }
 }
开发者ID:ashokadhikari92,项目名称:NCDB_Final,代码行数:21,代码来源:BirthDetailController.php

示例10: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $this->command->info('Start carrier seeder!');
     $config = ['url' => 'http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx?WSDL', 'company' => '', 'password' => '', 'postalCodeOrigin' => '05346000', 'format' => '1', 'ownHands' => '5', 'deliveryNotification' => 'N'];
     $carrier = Carrier::create(['name' => 'Correios', 'code' => 'CO', 'model_reference' => '\\App\\Services\\Shipment\\Shippers\\PostOffice', 'config' => json_encode($config)]);
     $services = $carrier->hasMany('App\\Models\\CarrierService');
     $services->saveMany([new CarrierService(['code' => 40010, 'delivery_time' => 8, 'name' => 'SEDEX', 'description' => '', 'status' => 1]), new CarrierService(['code' => 40045, 'delivery_time' => 1, 'name' => 'SEDEX a Cobrar', 'description' => '', 'status' => 1]), new CarrierService(['code' => 40215, 'delivery_time' => 1, 'name' => 'SEDEX 10, sem contrato', 'description' => '', 'status' => 1]), new CarrierService(['code' => 40290, 'delivery_time' => 1, 'name' => 'SEDEX Hoje, sem contrato', 'description' => '', 'status' => 0]), new CarrierService(['code' => 41068, 'delivery_time' => 1, 'name' => 'PAC', 'description' => '', 'status' => 0]), new CarrierService(['code' => 41106, 'delivery_time' => 1, 'name' => 'PAC, sem contrato', 'description' => '', 'status' => 1]), new CarrierService(['code' => 81019, 'delivery_time' => 5, 'name' => 'e-SEDEX', 'description' => '', 'status' => 0])]);
     $country = Country::find(30);
     $countries = $carrier->belongsToMany('App\\Models\\Country', 'shipment_carriers_countries', 'carrier_id', 'country_id');
     $countries->attach($country->id);
     $carrierTest = Carrier::create(['name' => 'Flat Rate Shipping', 'code' => 'FRS', 'model_reference' => '\\App\\Services\\Shipment\\Shippers\\FlatRateShipping']);
     $services = $carrierTest->hasMany('App\\Models\\CarrierService');
     $services->saveMany([new CarrierService(['code' => 'FRS', 'delivery_time' => 10, 'name' => 'Default', 'description' => '', 'status' => 1])]);
     $allCountry = Country::all();
     $countries = $carrierTest->belongsToMany('App\\Models\\Country', 'shipment_carriers_countries', 'carrier_id', 'country_id');
     foreach ($allCountry as $country) {
         $countries->attach($country->id);
     }
     $this->command->info('Carrier table seeded!');
 }
开发者ID:e-tipalchuk,项目名称:lumen-shipment-service,代码行数:25,代码来源:CarrierTableSeeder.php

示例11: myProfile

 public function myProfile()
 {
     $userId = Session::get('loggedinUserId');
     $userDetails = User::where('id', "=", $userId)->get()->toArray();
     $country = Country::all();
     $state = State::all();
     return view(Config('constants.frontendLoginView') . '.myprofile', compact('userDetails', 'country', 'state'));
 }
开发者ID:bhavs123,项目名称:web,代码行数:8,代码来源:UsersController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $paises = Country::all();
     return view('solo.paises.index', compact('paises'));
 }
开发者ID:adielhercules,项目名称:Taranis,代码行数:10,代码来源:CountryController.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Country::all();
 }
开发者ID:adielhercules,项目名称:Taranis,代码行数:9,代码来源:CountryController.php

示例14: index

 public function index()
 {
     // show all
     $records = Country::all();
     return $records;
 }
开发者ID:RHT-Memphis,项目名称:adc,代码行数:6,代码来源:CountriesController.php

示例15: showRegistrationForm

 /**
  * @param Role $role
  * @param Country $country
  * @param Age $age
  * @return mixed
  */
 public function showRegistrationForm(Role $role, Country $country, Age $age)
 {
     $param = collect();
     return view('web.users.create', compact('param'))->with('roles', $role->all())->with('countries', $country->all())->with('ages', $age->all());
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:11,代码来源:AuthController.php


注:本文中的app\models\Country::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。