Laravel wrapper for NS api
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE.md
README.md
composer.json
composer.lock

README.md

WIP WIP WIP

Contents may be subject to change at any time

WIP WIP WIP

Laravel NS API

Installation

The preferred way to install this extension is through composer.

To install, either run

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

or add

"edofre/laravel-ns-api": "*"

to the require section of your composer.json file.

Configuration

Publish assets and configuration files

php artisan vendor:publish --tag=config

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);