PHP code example of rensphilipsen / laravel-ns-api
1. Go to this page and download the library: Download rensphilipsen/laravel-ns-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rensphilipsen / laravel-ns-api example snippets
use RensPhilipsen\NSApi\NSApi;
$api = new NSApi();
// List disruptions/maintenance/calamities
$disruptions = $api->getDisruptions([
'type' => 'disruption',
'isActive' => true,
], 'nl');
// Fetch one disruption by type and id
$singleDisruption = $api->getDisruption('disruption', 'disruption-id', 'en');
// Fetch disruptions for a station
$stationDisruptions = $api->getDisruptionsByStationCode('ut', 'en');