承接 thedevsbuddy/laraworld 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

thedevsbuddy/laraworld

Composer 安装命令:

composer require thedevsbuddy/laraworld

包简介

A simple package for the world data (Country, State and City)

README 文档

README

A simple package for the world data (Country, State and City)

Build Status Total Downloads Latest Stable Version License

Get the country state and city related data for your laravel projects.

Installation

You can install the package via composer:

composer require thedevsbuddy/laraworld

Publish the assets

php artisan vendor:publish --provider="Devsbuddy\Laraworld\LaraworldServiceProvider"

Create Country, State and City tables and Import data.

php artisan laraworld:import

Usage

jQuery

LaraWorld uses ajax to fetch the country state and city data which requires jQuery as a dependency. So you will have to use jQuery in the page before adding laraworldScripte in the page.

Load jQuery and laraworldScripts In your app.blade.php or wherever needed.

<body>
    <!-- ...Other stuffs -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    @laraworldScripts
</body>

To show dropdown in any page for the country, state and city you can use.

<!-- Country Dropdown -->
<select name="country" id="country"></select>
<!-- State Dropdown -->
<select name="state" id="state"></select>
<!-- City Dropdown -->
<select name="city" id="city"></select>

That's it, You don't have to do anything else. Now it will automatically populate the countries and when you select a country it will show state list and so on.

Additional options

Set default value

If you want to set the default selected option / value you can do that as well. To set default value you can pass data-value property in the select element.

Example

<!-- 101 is the id of country (India) -->
<select id="country" name="country" data-value="101"></select> 

Select2

If you want to use select2 on your app we have also covered it.

To initialized select2 just add select2 class in the select element.

Example

<select id="country" name="country" class="select2"></select>

Note:- You will have to import select2 CDN in the page.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email shoaibkhan@devsbuddy.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固