salamwaddah/passport-visa-api
最新稳定版本:1.1.1
Composer 安装命令:
composer require salamwaddah/passport-visa-api
包简介
Passport Visa API - an unofficial passportindex.org API
关键字:
README 文档
README
An unofficial passportindex.org API - supports 199 passports
ABANDONED: You may inspect the code but it's no longer maintained, passportindex.org making it more difficult to scrape.
Showcase website
- Visa requirements per passport - Page is deleted
Installation
You can install the package via composer:
composer require salamwaddah/passport-visa-api
Usage
You can get all the visa requirements for a passport by using the get() method.
require_once __DIR__ . '/../vendor/autoload.php'; $passport = \SalamWaddah\PassportVisa\Passport::make('ma'); $passport->get(); // [ // "visa-free" => ["tr", etc...], // "visa-on-arrival" => ["lb", etc...], // "electronic-travel-authorization" => ["kr", etc...], // "e-visa" => ["jo", etc...], // "visa-required" => ["gb", etc...], // "not-admitted" => [], // "covid-ban" => [], // ]
Alternatively you can get the visa requirements for a passport by using the methods:
listVisaFree()listVisaOnArrival()listEta()listEVisa()listVisaRequired()listNotAdmitted()listCovidBan()
// list of visa free countries for your $passport $passport->listVisaFree(); // returns ["tr", etc...] // list of countries which do not admit your $passport $passport->listNotAdmitted(); // returns []
Caching
This library does not cache the results, you can use your own caching mechanism to avoid unnecessarily calling passportindex.org everytime. A recommended TTL for your cache is 1 day.
Testing
composer test
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-14