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
0
 /**
  * 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
0
 public function getNextTurn()
 {
     $turnManager = new TurnManager();
     foreach (Country::all() as $country) {
         $turnManager->doTurn($country);
     }
     return 'done!';
 }
示例#4
0
 /**
  * @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]);
 }
 /**
  * 获取国家列表.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     if ($request->ajax()) {
         return Country::all();
     } else {
         return view('res.country.index');
     }
 }
示例#6
0
 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
0
 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]);
 }
 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]);
 }
 /**
  * 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');
     }
 }
 /**
  * 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
0
 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
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $paises = Country::all();
     return view('solo.paises.index', compact('paises'));
 }
示例#13
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Country::all();
 }
示例#14
0
 public function index()
 {
     // show all
     $records = Country::all();
     return $records;
 }
示例#15
0
 /**
  * @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());
 }
示例#16
0
<?php

use App\Models\Client;
use App\Models\Contact;
use App\Models\Country;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/
$factory->define(Contact::class, function (Faker\Generator $faker) {
    return ['client_id' => function () {
        return factory(Client::class)->create()->id;
    }, 'user_id' => 1, 'account_id' => 1, 'public_id' => Contact::count() + 1, 'is_primary' => true, 'send_invoice' => true, 'first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'email' => $faker->safeEmail, 'phone' => $faker->phoneNumber];
});
$factory->define(Client::class, function (Faker\Generator $faker) {
    return ['user_id' => 1, 'account_id' => 1, 'public_id' => Client::count() + 1, '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];
});
示例#17
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function getEdit($id)
 {
     $userProfile = Profile::where('user_id', $id)->first();
     $countries = Country::all();
     foreach ($countries as $countryval) {
         $data[$countryval->countryID] = $countryval->countryName;
     }
     $statArr = array('' => 'Select Country');
     $result = array_merge($statArr, $data);
     $countryId = $userProfile['country_id'];
     $citylist = $this->userrepo->getcitylist($countryId);
     $datan = array();
     foreach ($citylist as $cityval) {
         $id = $cityval['cityID'];
         $name = $cityval['cityName'];
         $datan[$id] = $name;
     }
     /*
     	  	$statnArr = array( ' ' => 'Select City' );
     
     $cresult=array_merge($statnArr, $datan); 
      
     echo "<pre>";
     print_r($datan);
     echo "<br>============================<br>";
     echo "<pre>";
     print_r($cresult);
     
     exit;
     
     //dd($userProfile);
     */
     return view('admin.user.edit', ['userProfile' => $userProfile, 'countries' => $result, 'cityl' => $datan]);
 }
示例#18
0
 public function getEdit($id)
 {
     $authId = Auth::user()->id;
     $userProfile = Profile::where('user_id', $id)->first();
     $countries = Country::all();
     foreach ($countries as $countryval) {
         $data[$countryval->countryID] = $countryval->countryName;
     }
     $statArr = array('' => 'Select Country');
     $result = array_merge($statArr, $data);
     $countryId = $userProfile['country_id'];
     $citylist = $this->userrepo->getcitylist($countryId);
     $datan = array();
     foreach ($citylist as $cityval) {
         $id = $cityval['cityID'];
         $name = $cityval['cityName'];
         $datan[$id] = $name;
     }
     return view('home.edit', ['_menus' => $this->menuItems, '_errorNotification' => $this->errorNotification, 'login_url' => $this->login_url, 'userProfile' => $userProfile, 'countries' => $result, 'cityl' => $datan, 'dashBoardDetailsByAuthUser' => $this->userrepo->generalOverViewByAuthUser($authId)]);
 }
示例#19
0
 /**
  * Edit User
  *
  * @param User $user
  * @param Role $role
  * @param Country $country
  * @param Age $age
  * @return \Illuminate\Http\RedirectResponse
  */
 public function edit(User $user, Role $role, Country $country, Age $age)
 {
     return view('users.edit', compact('user'))->with('roles', $role->all())->with('countries', $country->all())->with('ages', $age->all());
 }
示例#20
0
 /**
  * Return all countries
  *
  * @param Country $country
  * @return \Illuminate\Http\JsonResponse
  */
 public function countries(Country $country)
 {
     return response()->json($country->all());
 }
示例#21
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $countries = Country::all()->groupBy('y')->groupBy('x');
     return view('field.index', compact('countries'));
 }