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


PHP Country::where方法代码示例

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


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

示例1: query

 /**
  * Returns a paginated country index.
  *
  * @param null|string $q
  * @return Paginator
  */
 public function query($q = null)
 {
     return Country::where(function ($query) use($q) {
         if (strlen($q) == 2) {
             $query->orWhere('iso_code_2', '=', $q);
         } elseif ($q) {
             $query->where('name', 'like', "%{$q}%");
         }
     })->orderBy('name')->paginate();
 }
开发者ID:manishkiozen,项目名称:Cms,代码行数:16,代码来源:CountryRepository.php

示例2: create

 /**
  * 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;
 }
开发者ID:HE-Arc,项目名称:demo-laravel-application,代码行数:16,代码来源:RegisterController.php

示例3: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::user()) {
         $countryId = Auth::user()->country_id;
     } else {
         $location = GeoIPFacade::getLocation();
         $countryId = Country::where('country_code', '=', $location['isoCode'])->first()->id;
     }
     $questions = Question::whereNotNull('questions.user_id')->whereNotNull('questions.question_category_id')->whereNotNull('questions.country_id')->where('questions.is_displayed', '=', 1)->where('questions.country_id', '=', $countryId)->where('questions_countries.country_id', '=', $countryId)->with('author')->with('category')->with('country')->join('questions_countries', 'questions.id', '=', 'questions_countries.question_id')->orderBy('questions_countries.count', 'DESC')->limit(5)->get();
     $allQuestions = Question::orderBy('updated_at', 'DESC')->paginate(10);
     return view('pages.home', compact('questions', 'allQuestions'));
 }
开发者ID:alex311982,项目名称:laravel5_online_support,代码行数:17,代码来源:HomeController.php

示例4: create

 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     /**
      * Get the Country of User
      */
     $geoip = \App::make('geoip');
     $user_ip = \Input::getClientIp();
     try {
         if ($user_geoip = $geoip->city($user_ip)) {
             $user_isoCode = $user_geoip->country->isoCode;
             $country = \App\Country::where('countryCode', 'LIKE', $user_isoCode)->first();
             /**
              * Country returned is not in Countrie table
              */
             if ($country == null) {
                 $user_country_id = 0;
             } else {
                 $user_country_id = $country->id;
             }
         }
     } catch (\Exception $e) {
         switch ($e) {
             case $e instanceof \InvalidArgumentException:
                 $user_country_id = 0;
                 break;
             case $e instanceof \GeoIp2\Exception\AddressNotFoundException:
                 $user_country_id = 0;
                 break;
             default:
                 $user_country_id = 0;
                 break;
         }
     }
     $confirmation_token = hash_hmac('sha256', str_random(40), $data['username']);
     $user = User::create(['username' => $data['username'], 'email' => $data['email'], 'name' => $data['name'], 'password' => bcrypt($data['password']), 'country_id' => $user_country_id, 'last_ipaddress' => $user_ip, 'confirmation_token' => $confirmation_token]);
     // Attach a role of Member to it.
     // Make sure your table named roles has Members row with Id of 5
     // Or use $user->attachRole($member); with $member as a instance of Role
     $user->roles()->attach(5);
     /**
      * Fire event on User Register
      */
     Event::fire(new UserRegistered($user));
     /**
      * Return User to handle auto Login after Registration.
      */
     return $user;
 }
开发者ID:kinnngg,项目名称:knightofsorrow,代码行数:54,代码来源:AuthController.php

示例5: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $date_id = \App\Date::where('date', '=', '2014-07-29')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2014-07-29-1270.jpg', 'caption' => 'Keylong, 2014', 'narrative' => 'Out for a stroll with Vortex, north towards Leh', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2014-07-23')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => "2014-07-23-1045.jpg", 'caption' => 'Brian Neill, 2014', 'narrative' => 'Beautiful, remote, wonderful...', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-10')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => "2013-06-10-0928.jpg", 'caption' => 'A Monastery', 'narrative' => '', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2014-07-23')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => "2014-07-23-1015.jpg", 'caption' => 'Brian Neill, 2014', 'narrative' => 'Beautiful, remote, wonderful...', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-09')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-09-0871.jpg', 'caption' => 'Leh', 'narrative' => 'once upon a time....', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-02')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-02-0157.jpg', 'caption' => 'Indian Railways', 'narrative' => 'On the narrow-gauge line at Jogindernagar.', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-07')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-07-0712.jpg', 'caption' => 'Prayer Flags', 'narrative' => 'The view from my breakfast table.', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-07')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-07-0749.jpg', 'caption' => 'Prayer Flags', 'narrative' => '', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-12')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-12-1101.jpg', 'caption' => 'Village wall, wood and sky', 'narrative' => '', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-14')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-14-1448.jpg', 'caption' => 'The road up to the Khardung La', 'narrative' => 'Getting high', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-15')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-15-1607.jpg', 'caption' => 'Khardung Village', 'narrative' => '', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-15')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-15-1625.jpg', 'caption' => 'Khardung Village', 'narrative' => '', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-16')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-16-1701.jpg', 'caption' => 'Clearing skies, from my hotel balconey', 'narrative' => '', 'date_id' => $date_id, 'country_id' => $country_id]);
     $date_id = \App\Date::where('date', '=', '2013-06-16')->pluck('id');
     $country_id = \App\Country::where('country', '=', 'India')->pluck('id');
     DB::table('images')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'filename' => '2013-06-16-1706.jpg', 'caption' => 'Sand dunes and scree, Hunder, Nubra Valley', 'narrative' => '', 'date_id' => $date_id, 'country_id' => $country_id]);
 }
开发者ID:dmorgorg,项目名称:dmphotos,代码行数:50,代码来源:ImagesTableSeeder.php

示例6: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $deleteChecked = Input::get('list');
     if ($deleteChecked) {
         foreach ($deleteChecked as $delete) {
             $resumdel1 = Country::where('id', $delete)->delete();
         }
         Session::flash('message', 'Successfully deleted');
     } else {
     }
     return Redirect::to('country');
 }
开发者ID:premsingh4github,项目名称:recruitment,代码行数:18,代码来源:CountryController.php

示例7: track

 /**
  * @return bool
  *
  * Track all round record into Database.
  */
 public function track()
 {
     /**
      * @var Game
      */
     $game = new Game();
     $game->tag = $this->roundTag;
     $game->server_time = $this->serverTime;
     $game->round_time = $this->timePlayed;
     $game->round_index = $this->roundIndex + 1 . " / " . $this->roundLimit;
     $game->gametype = $this->gameType;
     $game->outcome = $this->roundOutcome;
     $game->map_id = $this->gameMap;
     $game->total_players = $this->totalPlayers;
     $game->swat_score = $this->swatScore;
     $game->suspects_score = $this->suspectsScore;
     $game->swat_vict = $this->swatVictory;
     $game->suspects_vict = $this->suspectsVictory;
     if (!$game->save()) {
         return false;
     }
     /**
      * Iterate over each player array
      */
     foreach ($this->players as $p) {
         /**
          * @var Player
          */
         $player = new Player();
         $player->ingame_id = $p[0];
         $player->ip_address = $p[1];
         $player->name = str_replace('(VIEW)', '', $p[5]);
         $player->name = str_replace('(SPEC)', '', $player->name);
         $player->team = array_key_exists(6, $p) ? $p[6] : 0;
         $player->is_admin = array_key_exists(3, $p) ? $p[3] : 0;
         $player->is_dropped = array_key_exists(2, $p) ? $p[2] : 0;
         $player->score = array_key_exists(8, $p) ? $p[8] : 0;
         $player->time_played = array_key_exists(7, $p) ? $p[7] : 0;
         $player->kills = array_key_exists(9, $p) ? $p[9] : 0;
         $player->team_kills = array_key_exists(10, $p) ? $p[10] : 0;
         $player->deaths = array_key_exists(11, $p) ? $p[11] : 0;
         $player->suicides = array_key_exists(12, $p) ? $p[12] : 0;
         $player->arrests = array_key_exists(13, $p) ? $p[13] : 0;
         $player->arrested = array_key_exists(14, $p) ? $p[14] : 0;
         $player->kill_streak = array_key_exists(15, $p) ? $p[15] : 0;
         $player->arrest_streak = array_key_exists(16, $p) ? $p[16] : 0;
         $player->death_streak = array_key_exists(17, $p) ? $p[17] : 0;
         $player->game_id = $game->id;
         $player_ip_trim = substr($p[1], 0, strrpos($p[1], "."));
         $player_country_id = 0;
         $geoip = App::make('geoip');
         try {
             if ($player_geoip = $geoip->city($player->ip_address)) {
                 $player_isoCode = $player_geoip->country->isoCode;
                 $country = Country::where('countryCode', 'LIKE', $player_isoCode)->first();
                 /**
                  * Country returned is not in Countrie table
                  */
                 if ($country == null) {
                     $player_country_id = 0;
                 } else {
                     $player_country_id = $country->id;
                 }
             }
         } catch (\Exception $e) {
             switch ($e) {
                 case $e instanceof \InvalidArgumentException:
                     $player_country_id = 0;
                     break;
                 case $e instanceof \GeoIp2\Exception\AddressNotFoundException:
                     $player_country_id = 0;
                     break;
                 default:
                     $player_country_id = 0;
                     break;
             }
         }
         $loadout_array = array_key_exists(39, $p) ? $p[39] : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
         /**
          * @var Loadout
          *
          * Create or find and return instance of Loadout and save to database.
          */
         $loadout = Loadout::firstOrCreate(['primary_weapon' => array_key_exists(0, $loadout_array) ? $loadout_array[0] : 0, 'primary_ammo' => array_key_exists(1, $loadout_array) ? $loadout_array[1] : 0, 'secondary_weapon' => array_key_exists(2, $loadout_array) ? $loadout_array[2] : 0, 'secondary_ammo' => array_key_exists(3, $loadout_array) ? $loadout_array[3] : 0, 'equip_one' => array_key_exists(4, $loadout_array) ? $loadout_array[4] : 0, 'equip_two' => array_key_exists(5, $loadout_array) ? $loadout_array[5] : 0, 'equip_three' => array_key_exists(6, $loadout_array) ? $loadout_array[6] : 0, 'equip_four' => array_key_exists(7, $loadout_array) ? $loadout_array[7] : 0, 'equip_five' => array_key_exists(8, $loadout_array) ? $loadout_array[8] : 0, 'breacher' => array_key_exists(9, $loadout_array) ? $loadout_array[9] : 0, 'body' => array_key_exists(10, $loadout_array) ? $loadout_array[10] : 0, 'head' => array_key_exists(11, $loadout_array) ? $loadout_array[11] : 0]);
         /**
          * Create or find and return instance of Alias.
          */
         $alias = Alias::firstOrNew(['name' => $player->name]);
         /**
          * If Alias is not present then new instance is created.
          */
         if ($alias->id == null) {
             //$profile = Profile::firstOrNew(['ip_address' => $player_ip_trim.'%']);
             $profile = Profile::where('ip_address', 'LIKE', $player_ip_trim . '%')->first();
             // If no profile present create new else ignore.
//.........这里部分代码省略.........
开发者ID:kinnngg,项目名称:knightofsorrow,代码行数:101,代码来源:ServerTracker.php

示例8: destroyCountry

 /**
  * Remove a country from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroyCountry($id)
 {
     Country::where('id', $id)->delete();
     Session::flash('success_message', 'Country has been deleted from database');
     return redirect('config');
 }
开发者ID:smartrahat,项目名称:zamzam,代码行数:12,代码来源:MyConfigController.php

示例9: country

 public function country()
 {
     $country = Country::where('id', $this->countryID)->get();
     return $country;
 }
开发者ID:abreban,项目名称:RGU,代码行数:5,代码来源:User.php

示例10: ClearUpVariables

 public function ClearUpVariables($data, $hour_stamp)
 {
     //amend values as I wish
     $data['hour_stamp'] = $hour_stamp;
     $data['hour_stamp_flight_number'] = str_replace(' ', '', $hour_stamp . $data['flight_number']);
     //unique column
     $data['scheduled_time'] = Carbon::createFromFormat('d.m. H:i', $data['scheduled_time']);
     //airline code
     preg_match("|^..|", $data['flight_number'], $output_array_3);
     $data['airline_code'] = strtolower($output_array_3[0]);
     if ($data['airline_code'] == "ez") {
         $data['airline_code'] = "u2";
     }
     //easyjet not using their IATA code U2 but EZY - manual correction
     //terminal
     preg_match("|[1-9]|", $data['terminal'], $output_array_4);
     $data['terminal'] = $output_array_4[0];
     //destination
     $data['destination'] = strtolower($data['destination']);
     //keep all such data in lowercase (because Sqlite differentiate between Capitals and lower)
     preg_match("|(.*)\\((.*)\\)|", $data['destination'], $output_array_1);
     if (count($output_array_1) > 1) {
         $CitySlashAirport = $output_array_1[1];
         $data['country_code'] = $output_array_1[2];
     } else {
         $CitySlashAirport = null;
         $data['country_code'] = 'xx';
     }
     unset($data['destination']);
     //in case some strange codes comes
     $country = Country::where('country_code', $data['country_code']);
     if (count($country) == 0) {
         $newcountry = new Country();
         $newcountry->country_code = $data['country_code'];
         $newcountry->country_name = 'Undefined';
         $newcountry->save();
     }
     $output_array_2 = preg_split("|\\/|", $CitySlashAirport);
     $data['city'] = $output_array_2[0];
     if (empty($data['city'])) {
         $data['city'] = 'empty';
     }
     if (count($output_array_2) > 1) {
         $data['airport'] = $output_array_2[1];
     } else {
         $data['airport'] = null;
     }
     //city_slug
     $slug = new SlugClass();
     $data['city_slug'] = $slug->slugify($data['city']);
     //find if this city_slug is in cities table
     $city_slug_in_cities = City::where('city_slug', $data['city_slug'])->first();
     if (empty($city_slug_in_cities)) {
         $city_slug_bridge = Slug::where('city_slug_dirty', $data['city_slug'])->first();
         if (!empty($city_slug_bridge)) {
             $data['city_slug'] = $city_slug_bridge->city_slug_clean;
             echo $data['city_slug'];
         }
     }
     $data = array_map('trim', $data);
     //trim values
     return $data;
 }
开发者ID:jedlicka82,项目名称:pragueairport,代码行数:63,代码来源:PragueAirportScraper.php

示例11: findCountryByCode

 public function findCountryByCode($countryCode)
 {
     return Country::where('country_code', $countryCode)->first();
 }
开发者ID:skiwei,项目名称:sayangholidays,代码行数:4,代码来源:CountryRepository.php

示例12: country

 public function country($country)
 {
     $this_country = Country::where('country_slug', $country)->first();
     $cities = Flight::with('country')->whereHas('country', function ($query) use($country) {
         $query->where('country_slug', $country);
     })->where('scheduled_time', '>', Carbon::now()->subMonths(1))->groupBy('city', 'asc')->get();
     $airlines = Flight::with('country')->whereHas('country', function ($query) use($country) {
         $query->where('country_slug', $country);
     })->where('scheduled_time', '>', Carbon::now()->subMonths(1))->where('codeshare', 0)->orderBy('airline', 'asc')->groupBy('airline')->get();
     $arrivals = Flight::with('country')->whereHas('country', function ($query) use($country) {
         $query->where('country_slug', $country);
     })->where('codeshare', 0)->where('arrival', 1)->orderBy('scheduled_time', 'desc')->take(15)->get();
     $departures = Flight::with('country')->whereHas('country', function ($query) use($country) {
         $query->where('country_slug', $country);
     })->where('codeshare', 0)->where('departure', 1)->orderBy('scheduled_time', 'desc')->take(15)->get();
     return view('pages.country')->with(['this_country' => $this_country, 'cities' => $cities, 'airlines' => $airlines, 'arrivals' => $arrivals, 'departures' => $departures]);
 }
开发者ID:jedlicka82,项目名称:pragueairport,代码行数:17,代码来源:PagesController.php

示例13: hash

 public function hash(Request $request, $key)
 {
     $link = DB::table('keys')->where('key', '=', $key)->get();
     if ($link) {
         $current_ip = $request->getClientIp();
         $test = app('Illuminate\\Routing\\UrlGenerator')->previous();
         // $name = $this->get_title($test);
         $name = 'google.com';
         $location = GeoIPFacade::getLocation('202.142.69.126');
         $os_info = parser::detect();
         //City data
         if (!City::where('city_name', $location['city'])->count()) {
             $city = new City();
             $city_id = $city->insertGetId(['city_name' => $location['city']]);
         } else {
             $city_id = City::where('city_name', $location['city'])->value('id');
         }
         //Country Data
         if (!Country::where('country_name', $location['country'])->count()) {
             $country = new Country();
             $country_id = $country->insertGetId(['country_name' => $location['country']]);
         } else {
             $country_id = Country::where('country_name', $location['country'])->value('id');
         }
         //Os Data
         if (!Operating_system::where('operating_system', $os_info['osFamily'])->count()) {
             $os = new Operating_system();
             $os_id = $os->insertGetId(['operating_system' => $os_info['osFamily']]);
         } else {
             $os_id = Operating_system::where('operating_system', $os_info['osFamily'])->value('id');
         }
         //Browser_data
         if (!Browser::where('browser_name', $os_info['browserFamily'])->count()) {
             $browser = new Browser();
             $browser_id = $browser->insertGetId(['browser_name' => $os_info['browserFamily']]);
         } else {
             $browser_id = Browser::where('browser_name', $os_info['browserFamily'])->value('id');
         }
         //Redirected Website data
         $website_hits = new Redirected_websites();
         $website_hits->user_id = $link[0]->user_id;
         $website_hits->url_id = $link[0]->id;
         $website_hits->city_id = $city_id;
         $website_hits->country_id = $country_id;
         $website_hits->website_url = $test;
         $website_hits->website_name = $name;
         $website_hits->browser_id = $browser_id;
         $website_hits->os_id = $os_id;
         $website_hits->is_mobile = $os_info['isMobile'];
         $website_hits->is_tablet = $os_info['isTablet'];
         $website_hits->is_desktop = $os_info['isDesktop'];
         //Hits data
         $data = new Hit();
         $data->url_ip = $current_ip;
         $data->url_id = $link[0]->id;
         $data->save();
         $website_hits->save();
         //Deep linking
         if (parser::isMobile()) {
             if (parser::osFamily() == 'Apple iOS') {
                 //link for apple store
             } elseif (parser::osFamily() == 'Windows') {
                 return redirect('https://www.microsoft.com/en-us/store/apps/google/9wzdncrfhx3w');
             } elseif (parser::osFamily() == 'Blackberry') {
                 //link for blackberry store
             } elseif (parser::osFamily() == 'AndroidOS') {
                 return redirect('https://play.google.com/store/apps/details?id=com.facebook.katana&hl=en');
             }
         }
         if (parser::isMobile()) {
             if (parser::osFamily() == 'Apple iOS') {
                 //link for apple store
             } elseif (parser::osFamily() == 'Windows') {
                 return redirect('https://www.microsoft.com/en-us/store/apps/google/9wzdncrfhx3w');
             } elseif (parser::osFamily() == 'Blackberry') {
                 //link for blackberry store
             } elseif (parser::osFamily() == 'AndroidOS') {
                 return redirect('https://play.google.com/store/apps/details?id=com.facebook.katana&hl=en');
             }
         } else {
             return redirect($link[0]->url);
         }
     } else {
         return redirect('/');
     }
 }
开发者ID:vikashkrkashyap,项目名称:url,代码行数:86,代码来源:UrlController.php

示例14: voiceCall

 public function voiceCall(Request $request)
 {
     $data = $request->all();
     if (isset($data['id'])) {
         Response::json(array("status" => 'failure', "msg" => 'Missing argument'));
     }
     $regDetails = RegistrationDetails::find($data['id']);
     if (!$regDetails) {
         return Response::json(array("status" => "failure", "msg" => "No data is present"));
     }
     $phone_no = $regDetails->phone_no;
     $country = $regDetails->country;
     if (!$country) {
         return Response::json(array("status" => "failure", "msg" => "Country missing"));
     }
     $countryData = Country::where('name', "LIKE", $country)->first();
     $phnCode = $countryData->phonecode;
     $phone = "+" . $phnCode . $phone_no;
     $mCode = $this->generateRandomString(4);
     $array = str_split($mCode);
     $regDetails->mobile_code = $mCode;
     $regDetails->save();
     $twilio = Twilio::call($phone, $_ENV['app_url'] . "/callForMobileCode/{$array['0']}/{$array['1']}/{$array['2']}/{$array['3']}");
 }
开发者ID:njugunanduati,项目名称:mobile,代码行数:24,代码来源:RegistrationController.php

示例15: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create($country_id)
 {
     $countries = Country::where('id', '=', $country_id)->get();
     $languages = Language::all();
     return view('createCity', ['countries' => $countries, 'languages' => $languages, 'country_id' => $country_id]);
 }
开发者ID:mudragel,项目名称:matematika-test.loc,代码行数:11,代码来源:CityController.php


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