承接 salamwaddah/passport-visa-api 相关项目开发

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

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

salamwaddah/passport-visa-api

最新稳定版本:1.1.1

Composer 安装命令:

composer require salamwaddah/passport-visa-api

包简介

Passport Visa API - an unofficial passportindex.org API

README 文档

README

Latest Version on Packagist Total Downloads MIT Licensed

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

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-14