rensphilipsen/laravel-ns-api
最新稳定版本:v1.0.4
Composer 安装命令:
composer require rensphilipsen/laravel-ns-api
包简介
A Laravel wrapper for the Nederlandse Spoorwegen (NS) API
README 文档
README
This package is a wrapper for the Nederlandse Spoorwegen (NS) API.
Installation
Install via composer
composer require rensphilipsen/laravel-ns-api
Configuration
Publish the configuration by running
php artisan vendor:publish --provider="RensPhilipsen\NSApi\NSApiServiceProvider" --tag="config"
Examples
Get all stations
To fetch all the NS stations:
$api = new NSApi();
// Optionally set a limit as first parameter, defaults to 0 which is all stations
$api->getStations(32);
Get departures by station code
$api = new NSApi();
// The first parameter is the stations `code`.
// The second parameter (optional) is the amount of departures/journeys. Defaults to 32.
$api->getDeparturesByStationCode('ut', 32)
Get arrivals by station code
$api = new NSApi();
// The first parameter is the stations `code`.
// The second parameter (optional) is the amount of arrivals/journeys. Defaults to 32.
$api->getArrivalsByStationCode('ut', 32)
统计信息
- 总下载量: 980
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-06