kinatechsolutions/world-data
最新稳定版本:1.0.1
Composer 安装命令:
composer require kinatechsolutions/world-data
包简介
World data package includes, countries, states, cities, currencies and languages
README 文档
README
A laravel package that provides listing of world data including, countries, cities, currencies, postal codes and languages.
Installation
To install this package run
composer require kinatechsolutions/world-data
Then run migrations to create the database tables.
php artisan migrate
To populate your models with data run
php artisan world:populate
Usage/Examples
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Kinatech\World\Facade\World; class MyController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\JsonResponse */ public function index() { $postalCodes = World::postalCode() ->where('country_code', 'KE') ->get(); $countries = World::country()->get(); $states = World::state()->get(); $cities = World::city()->get(); $languages = World::language()->get(); $currencies = World::currency()->get(); return response()->json([ 'data' => $postalCodes ]); } }
Contributing
Contributions are always welcome!
See contributing.md for ways to get started.
Please adhere to this project's code of conduct.
Authors
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-11