heivin / chinese-package
Common Chinese development resources in Laravel
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-12-25 19:43:08 UTC
README
Common Chinese development resources in Laravel 常用中文开发资源: 省市县区 地图数据
Province
Example
require_once __DIR__ . '/../../vendor/autoload.php'; // Autoload files using Composer autoload
use Heivin\Chinese;
var_dump( Chinese::province() ); // Array
echo Chinese::city('json'); // Json
var_dump( Chinese::area() ); // Array
var_dump(json_encode(Chinese::map('anhui')));
var_dump(json_encode(Chinese::map('anhui','json'))); //Json
Laravel
5.x
use Heivin\Chinese;
class IndexController extends Controller {
public function test(){
return response()->json(Chinese::province()); // Response with json
return response(Chinese::city('json'))->header('Content-Type', 'text/json'); // Response with json
}
}
TODO List
- 电话区号
- 身份证识别
- IP段
- 经纬度