2017 © Pedro Peláez
 

library laravel-ns-api

Laravel wrapper for the NS API

image

edofre/laravel-ns-api

Laravel wrapper for the NS API

  • Saturday, February 4, 2017
  • by edofre
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel NS API wrapper

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

To install, either run, (*3)

$ php composer.phar require edofre/laravel-ns-api

or add, (*4)

"edofre/laravel-ns-api": "v1.0.0"

to the require section of your composer.json file., (*5)

Configuration

Publish assets and configuration files, (*6)

php artisan vendor:publish --tag=config

In the above configuration file you will need to enter your NS API username and password, (*7)

Example

Get all the stations

$api = new NsApi();
$stations = $api->getStations();

Get all the departing trains from a station

$api = new NsApi();
$station = new Station('UT', '','','','','','','','','');
$departing_trains = $api->getDepartures($station);

Get all the disturbances from a station

$api = new NsApi();
$station = new Station('ut', '', '', '', '', '', '', '', '', '');
// We want the actual disturbances and not the unplanned disturbances
$disturbances = $api->getDisturbances($station, true , false);

Get the prices for a route

$api = new NsApi();
$from_station = new Station('ZL', '', '', '', '', '', '', '', '', '');
$via_station = new Station('DH', '', '', '', '', '', '', '', '', '');
$to_station = new Station('HT', '', '', '', '', '', '', '', '', '');
$prices = $api->getPrices($from_station, $to_station, $via_station);

The Versions

04/02 2017

dev-master

9999999-dev https://github.com/edofre/laravel-ns-api

Laravel wrapper for the NS API

  Sources   Download

MIT

The Requires

 

by Edo Freriks

laravel api ns trein

04/02 2017

v1.0.0.x-dev

1.0.0.9999999-dev https://github.com/edofre/laravel-ns-api

Laravel wrapper for the NS API

  Sources   Download

MIT

The Requires

 

by Edo Freriks

laravel api ns trein

04/02 2017

V1.0.0

1.0.0.0 https://github.com/edofre/laravel-ns-api

Laravel wrapper for the NS API

  Sources   Download

MIT

The Requires

 

by Edo Freriks

laravel api ns trein