本文整理汇总了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'));
}
示例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]);
}
示例3: getNextTurn
public function getNextTurn()
{
$turnManager = new TurnManager();
foreach (Country::all() as $country) {
$turnManager->doTurn($country);
}
return 'done!';
}
示例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]);
}
示例5: index
/**
* 获取国家列表.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
if ($request->ajax()) {
return Country::all();
} else {
return view('res.country.index');
}
}
示例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'));
}
示例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]);
}
示例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]);
}
示例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');
}
}
示例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!');
}
示例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'));
}
示例12: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$paises = Country::all();
return view('solo.paises.index', compact('paises'));
}
示例13: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return Country::all();
}
示例14: index
public function index()
{
// show all
$records = Country::all();
return $records;
}
示例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());
}