{"id":18850186,"url":"https://github.com/edofre/laravel-ns-api","last_synced_at":"2026-02-03T07:30:18.391Z","repository":{"id":56975150,"uuid":"78469066","full_name":"Edofre/laravel-ns-api","owner":"Edofre","description":"Laravel wrapper for NS api","archived":false,"fork":false,"pushed_at":"2017-02-04T15:15:09.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T15:38:31.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Edofre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-09T21:07:02.000Z","updated_at":"2017-01-10T20:04:42.000Z","dependencies_parsed_at":"2022-08-21T11:50:17.543Z","dependency_job_id":null,"html_url":"https://github.com/Edofre/laravel-ns-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Flaravel-ns-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Flaravel-ns-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Flaravel-ns-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Flaravel-ns-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edofre","download_url":"https://codeload.github.com/Edofre/laravel-ns-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239786251,"owners_count":19696772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T03:28:19.522Z","updated_at":"2026-02-03T07:30:18.345Z","avatar_url":"https://github.com/Edofre.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel NS API wrapper\n\n[![Latest Stable Version](https://poser.pugx.org/edofre/laravel-ns-api/v/stable)](https://packagist.org/packages/edofre/laravel-ns-api)\n[![Total Downloads](https://poser.pugx.org/edofre/laravel-ns-api/downloads)](https://packagist.org/packages/edofre/laravel-ns-api)\n[![Latest Unstable Version](https://poser.pugx.org/edofre/laravel-ns-api/v/unstable)](https://packagist.org/packages/edofre/laravel-ns-api)\n[![License](https://poser.pugx.org/edofre/laravel-ns-api/license)](https://packagist.org/packages/edofre/laravel-ns-api)\n[![composer.lock](https://poser.pugx.org/edofre/laravel-ns-api/composerlock)](https://packagist.org/packages/edofre/laravel-ns-api)\n\n## Installation\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nTo install, either run\n\n```\n$ php composer.phar require edofre/laravel-ns-api\n```\n\nor add\n\n```\n\"edofre/laravel-ns-api\": \"v1.0.0\"\n```\n\nto the ```require``` section of your `composer.json` file.\n\n## Configuration\n\nPublish assets and configuration files\n```\nphp artisan vendor:publish --tag=config\n```\n\nIn the above configuration file you will need to enter your NS API username and password\n\n### Example\n\n#### Get all the stations\n```php\n$api = new NsApi();\n$stations = $api-\u003egetStations();\n```\n\n#### Get all the departing trains from a station\n```php\n$api = new NsApi();\n$station = new Station('UT', '','','','','','','','','');\n$departing_trains = $api-\u003egetDepartures($station);\n```\n\n#### Get all the disturbances from a station\n```php\n$api = new NsApi();\n$station = new Station('ut', '', '', '', '', '', '', '', '', '');\n// We want the actual disturbances and not the unplanned disturbances\n$disturbances = $api-\u003egetDisturbances($station, true , false);\n```\n\n#### Get the prices for a route\n```php\n$api = new NsApi();\n$from_station = new Station('ZL', '', '', '', '', '', '', '', '', '');\n$via_station = new Station('DH', '', '', '', '', '', '', '', '', '');\n$to_station = new Station('HT', '', '', '', '', '', '', '', '', '');\n$prices = $api-\u003egetPrices($from_station, $to_station, $via_station);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedofre%2Flaravel-ns-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedofre%2Flaravel-ns-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedofre%2Flaravel-ns-api/lists"}