mehr-it/lara-countries 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mehr-it/lara-countries

Composer 安装命令:

composer require mehr-it/lara-countries

包简介

Extendable multilingual, countries list for Laravel

README 文档

README

Latest Version on Packagist Build Status

Localized country and language list for Laravel with all ISO codes.

Country list contains following data:

  • alpha-2 country code (ISO 3166-1)
  • alpha-3 country code (ISO 3166-1)
  • Country name (in all locales)
  • Dialing code (eg. 49 for Germany)

Language list contaings following data:

  • alpha-2 language code (ISO 639-1)
  • Language name (in all locales)

Unlike many other packages, it does not use a hardcoded list but imports the selected data to the database. For faster performance the data is cached locally in PHP files which are synchronized via the central application cache.

This way you get best performance but are still free to edit data.

Installation

Install the package using composer. Laravel's package auto discovery will do the rest for you:

composer require  mehr-it/lara-countries

Import country data

After installation you have to import data to the database: To import the country/language list, run following command:

artisan countries:import
artisan languages:import

This imports the country/language list. If you need any other locale than "en", you can import them using following command:

artisan countries:importLocale de
artisan languages:importLocale de

Usage

You can access country information using the Countries facade:

// get country information
Countries::get('US');

// get country information with other locale than the application locale
Countries::get('US', 'de');

// check if country code exists
Countries::exists('US');

// list all countries
Countries::all();

// list all countries with other locale than the application locale
Countries::all('de');

// list all iso2 codes
Countries::allIso2Codes();

You can access language information using the Languages facade:

// get language information
Languages::get('en');

// get language information with other locale than the application locale
Languages::get('en', 'de');

// check if language code exists
Languages::exists('US');

// list all languages
Languages::all();

// list all languages with other locale than the application locale
Languages::all('de');

// list all iso2 codes
Languages::allIso2Codes();

统计信息

  • 总下载量: 1.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固