kinatechsolutions / world-data
World data package includes, countries, states, cities, currencies and languages
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/kinatechsolutions/world-data
Requires
- php: ^8.1
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.