Download the PHP package kayschima/deutsche-bahn without Composer
On this page you can find all versions of the php package kayschima/deutsche-bahn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kayschima/deutsche-bahn
More information about kayschima/deutsche-bahn
Files in kayschima/deutsche-bahn
Package deutsche-bahn
Short Description Laravel package for Deutsche Bahn timetables
License MIT
Homepage https://github.com/kayschima/deutsche-bahn
Informations about the package deutsche-bahn
Deutsche Bahn Timetables
"Deutsche Bahn" is a laravel package for timetables of german railway stations
Installation
Via Composer
Publish the config file
Usage
The usage of the package is quite simple:
- Get you API token at (https://developer.deutschebahn.com/store/).
- Fetch and install this package via Composer
- Set your API token in your .env file:
Facade
You can use three different functions in this package:
The first two functions expect
- an id a train station in Germany (in this example 'Bremen')
- a DateTime instance for date and time of the arrivals/departures
- a boolean (details of the train wanted of not)
If you want to know details about a specific train journey, enter the id of that train journey in the 'getDetails' function. You might get these ids by calling 'getArrivals' or 'getDepartures' before.
All functions return an array as a result. In later versions of the package we will also pass the results of the REST call on to the user.
Until then, an empty array is returned as the function result if an error occurs when calling the Deutsche Bahn api or the function has generally not determined any results.
Artisan command
This package also provides an artisan coommand to get the id of a certain railway station of Deutsche Bahn.
Just answer the question about the desired train station and a number of possible IDs will be displayed.
Change log
Please see the changelog for more information on what has changed recently.
Testing
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
- Kay Markschies
- All Contributors
License
license. Please see the license file for more information.