/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function countries()
 {
     $results = \Excel::load('country_list.xlsx', function ($reader) {
     })->get();
     foreach ($results as $row) {
         $country = new Country();
         $country->country_code = $row->country_code;
         $country->country_name = $row->country_name;
         $country->country_name_in_albanian = $row->country_name_in_albanian;
         $country->country_name_in_czech = $row->country_name_in_czech;
         $country->country_name_in_dutch_belgium = $row->country_name_in_dutch_belgium;
         $country->country_name_in_finnish = $row->country_name_in_finnish;
         $country->country_name_in_greek = $row->country_name_in_greek;
         $country->country_name_in_hungarian = $row->country_name_in_hungarian;
         $country->country_name_in_kazakh = $row->country_name_in_kazakh;
         $country->country_name_in_macedonian = $row->country_name_in_macedonian;
         $country->country_name_in_polish = $row->country_name_in_polish;
         $country->country_name_in_portuguese = $row->country_name_in_portuguese;
         $country->country_name_in_romanian = $row->country_name_in_romanian;
         $country->country_name_in_russian = $row->country_name_in_russian;
         $country->country_name_in_slovak = $row->country_name_in_slovak;
         $country->country_name_in_spanish = $row->country_name_in_spanish;
         $country->country_name_in_turkish = $row->country_name_in_turkish;
         $country->continent = $row->continent;
         $country->iseurope = $row->iseurope;
         $country->save();
     }
 }
예제 #2
0
 /**
  * Set the country that should be delivered to.
  *
  * @param Country $country
  * @throws InvalidArgumentException
  */
 public function setCountry(Country $country)
 {
     if (!$country->canBeShippedTo()) {
         throw new InvalidArgumentException(trans('countries.cannot_be_shipped_to', ['name' => $country->name]));
     }
     $this->country = $country;
 }
 public function run()
 {
     DB::table('countries')->truncate();
     $country = new Country();
     $country->name = 'England';
     $country->country_code = 'EN';
     //        $language->icon = "icon_flag_gb.gif";
     $country->icon = "flag-en";
     $country->save();
     $country = new Country();
     $country->name = 'Ukraine';
     $country->country_code = 'UA';
     //        $language->icon = "icon_flag_sr.gif";
     $country->icon = "flag-ua";
     $country->save();
     $country = new Country();
     $country->name = 'Russia';
     $country->country_code = 'RU';
     //        $language->icon = "icon_flag_bs.gif";
     $country->icon = "flag-ru";
     $country->save();
     $country = new Country();
     $country->name = 'USA';
     $country->country_code = 'US';
     //        $language->icon = "icon_flag_bs.gif";
     $country->icon = "flag-us";
     $country->save();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // Model::unguard();
     //create a user
     $user = new User();
     $user->email = "*****@*****.**";
     $user->password = Hash::make('password');
     $user->save();
     //create a country
     $country = new Country();
     $country->name = "United States";
     $country->id = 236;
     $country->save();
     //create a state
     $state = new State();
     $state->name = "Pennsylvania";
     $state->id = 1;
     $state->save();
     $city = new City();
     $city->name = "Pittsburgh";
     $city->id = 1;
     $city->save();
     //create a location
     $location = new Location();
     $location->city_id = $city->id;
     $location->state_id = $state->id;
     $location->country_id = $country->id;
     $location->latitude = 40.44;
     $location->longitude = 80;
     $location->code = '15212';
     $location->address_1 = "100 Main Street";
     $location->save();
     //create a new accommodation
     $accommodation = new Accommodation();
     $accommodation->name = "Royal Plaza Hotel";
     $accommodation->location_id = $location->id;
     // $location->id;
     $accommodation->description = "A modern, 4-star hotel";
     $accommodation->save();
     //create a room
     $room1 = new App\Room();
     $room1->id = 1;
     $room1->room_number = 'A01';
     $room1->accommodation_id = $accommodation->id;
     $room1->save();
     //create another room
     $room2 = new Room();
     $room2->id = 2;
     $room2->room_number = 'A02';
     $room2->accommodation_id = $accommodation->id;
     $room2->save();
     //create the room array
     $rooms = [$room1, $room2];
     //$this->call('AuthorsTableSeeder');
     //$this->command->info('Authors table seeded!');
     //
     $this->call(AmenityTableSeeder::class);
     $this->command->info('Amenity Class Seeded table seeded!');
 }
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     DB::table('country')->truncate();
     $country_nz = ['name' => "New Zealand", 'meta_desc' => "New Zealand is an island country in the southern Pacific Ocean. The country comprises two main landmasses – the North Island, South Island, and others.", 'long_desc' => "New Zealand (Māori: Aotearoa) is an island country in the southwestern Pacific Ocean. The country geographically comprises two main landmasses – that of the North Island, or Te Ika-a-Māui, and the South Island, or Te Waipounamu – and numerous smaller islands. New Zealand is situated some 1,500 kilometres (900 mi) east of Australia across the Tasman Sea and roughly 1,000 kilometres (600 mi) south of the Pacific island areas of New Caledonia, Fiji, and Tonga. Because of its remoteness, it was one of the last lands to be settled by humans. During its long isolation, New Zealand developed a distinctive biodiversity of animal, fungal and plant life. The country's varied topography and its sharp mountain peaks, such as the Southern Alps, owe much to the tectonic uplift of land and volcanic eruptions. New Zealand's capital city is Wellington, while its most populous city is Auckland.", 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()];
     $country = new Country($country_nz);
     $country->save();
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
 }
예제 #6
0
 public static function findOrCreate($data)
 {
     $country = self::where('name', $data['country'])->first();
     if (count($country) <= 0) {
         $country = new Country();
         $country->name = $data['country'];
         $country->save();
     }
     return $country;
 }
예제 #7
0
 public function postCountry(Request $request)
 {
     $name = $request['country_name'];
     $description = $request['country_description'];
     $status = true;
     $country = new Country();
     $country->name = $name;
     $country->description = $description;
     $country->status = $status;
     $country->save();
     return redirect()->route('country')->with(['message' => 'Successfully Saved!']);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $country = Country::find($request->country_id);
     $city = City::find($request->city_id);
     $state = State::find($request->state_id);
     return ['country' => $country->name, 'city' => $city->name, 'state' => $state->name];
 }
예제 #9
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $countries = Cache::remember('countries', 15, function () {
         return Country::orderBy('name')->get();
     });
     return response()->json(['data' => $countries], 200);
 }
예제 #10
0
 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'));
 }
예제 #11
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(EditCountryRequest $request, $id)
 {
     $country = Country::findOrFail($id);
     $country->fill($request->all());
     $country->save();
     return redirect()->route('settings.country.index');
 }
 public function edit($id)
 {
     $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all();
     $clubs = Club::orderBy('name', 'asc')->get()->lists('name_town', 'id')->all();
     $competitor = Competitor::whereId($id)->firstOrFail();
     return view('backend.competitors.edit', compact('competitor', 'countries', 'clubs'));
 }
 public function edit($id)
 {
     $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all();
     $categories = Category::lists('category', 'category')->all();
     $competition = Competition::whereId($id)->firstOrFail();
     return view('backend.competitions.edit', compact('competition', 'countries', 'categories'));
 }
 /**
  * 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";
     }
 }
예제 #15
0
 public function run()
 {
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 20; $i++) {
         \App\Country::create(['title' => $faker->unique()->country]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('countries')->delete();
     Country::create(['code' => 'ch', 'en' => ['name' => 'Switzerland'], 'fr' => ['name' => 'Suisse'], 'de' => ['name' => 'Schweiz']]);
     Country::create(['code' => 'fr', 'en' => ['name' => 'France'], 'fr' => ['name' => 'France'], 'de' => ['name' => 'Frankreich']]);
     Country::create(['code' => 'de', 'en' => ['name' => 'Germany'], 'fr' => ['name' => 'Allemagne'], 'de' => ['name' => 'Deutschland']]);
 }
 public function index()
 {
     $newestAuction = Auction::where('FK_status_id', '=', 1)->orWhere('FK_status_id', '=', 3)->orderBy('created_at', 'desc')->first();
     $countries = ['default' => 'Kies een land'] + Country::orderby('nameDutch', 'ASC')->lists('nameDutch', 'id')->all();
     // $countriesEnglish = ['default'=>'Choose a country'] + Country::orderby('nameEnglish', 'ASC')->lists('nameEnglish', 'id')->all();
     return View::make('register')->with('countries', $countries)->with('newestAuction', $newestAuction);
 }
예제 #18
0
 /**
  * Execute the job.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function handle()
 {
     // Language.
     $language = Language::findOrNew(1);
     if (!$language->id) {
         $language->id = 1;
         $language->name = 'english';
         $language->prefix = 'en';
         $language->save();
     }
     // Country.
     $country = Country::findOrNew(1);
     if (!$country->id) {
         $country->id = 1;
         $country->name = 'spain';
         $country->prefix = 'spa';
         $country->save();
     }
     // User.
     $user = User::findOrNew(1);
     if (!$user->id) {
         $user->id = 1;
         $user->name = 'Test';
         $user->surname = 'Test';
         $user->email = '*****@*****.**';
         $user->direction = 'this should be called address lol';
         $user->birthday = '2000-01-01';
         $user->language_id = $language->id;
         $user->country_id = $country->id;
         $user->save();
     }
     $created = $user->tasks()->create($this->requestParams);
     return response()->json($created);
 }
예제 #19
0
 public function run()
 {
     DB::table('countries')->delete();
     Country::create(['name' => 'Vietnam']);
     Country::create(['name' => 'France']);
     Country::create(['name' => 'England']);
     Country::create(['name' => 'China']);
 }
예제 #20
0
 /**
  * Fetch countries from database
  *
  * @param  bool
  *
  * @return Illuminate\Database\Eloquent\Collection (of Country)
  */
 protected function getCountries($withTrashed)
 {
     $countries = Country::select('id', 'iso_3166_2', 'name')->orderBy('name');
     if ($withTrashed) {
         $countries->withTrashed();
     }
     return $countries->get();
 }
예제 #21
0
 /**
  * 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));
 }
예제 #22
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $user = Country::with('states', 'states.cities')->find(101)->toArray();
     echo '<pre>';
     print_r($user);
     echo '</pre>';
     die;
 }
예제 #23
0
 public function create(ApplicationRequest $request)
 {
     $services = Service::join('service_visas', 'services.id', '=', 'service_visas.service_id')->select('services.id', 'services.name', 'min_process', 'max_process')->orderBy('min_process')->orderBy('max_process')->where('country_id', '=', $request->get('country'))->groupBy('services.id')->get();
     $service = $services->first();
     $states = DB::table('states')->orderBy('name', 'asc')->lists('name', 'id');
     $countries = Country::orderBy('name')->lists('name', 'id');
     $country = Country::find($request->get('country'));
     return View('apply', ['services' => $services->lists('title', 'id'), 'service' => $service, 'country' => $country, 'countries' => $countries, 'states' => $states]);
 }
예제 #24
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('countries')->delete();
     $json = File::get(storage_path() . '/json/country_with_dialCodes.json');
     $data = json_decode($json);
     foreach ($data as $object) {
         Country::create(['alpha2_code' => $object->alpha2_code, 'alpha3_code' => $object->alpha3_code, 'name' => $object->name, 'dial_code' => $object->dial_code]);
     }
 }
예제 #25
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('countries')->delete();
     $countriesJson = File::get(storage_path() . "/jsondata/countries.json");
     $countries = json_decode($countriesJson, true);
     foreach ($countries as $country) {
         Country::create(array('name' => $country->common, 'code' => $country->cca2));
     }
 }
예제 #26
0
 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'));
 }
예제 #27
0
 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'));
 }
예제 #28
0
 /**
  * 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'));
 }
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $user = User::create(['username' => $data['username'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     if (isset($data['country'])) {
         $country = Country::where('code', $data['country'])->first();
         $user->country()->associate($country);
         $user->save();
     }
     return $user;
 }
예제 #30
0
 public function show($id)
 {
     $links[1] = 'active';
     try {
         $country = Country::findOrFail($id);
     } catch (ModelNotFoundException $ex) {
         return view('errors.404');
     }
     return view('country.show', ['country' => $country, 'links' => $links]);
 }