PHPackages                             kayschima/deutsche-bahn - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kayschima/deutsche-bahn

ActiveLibrary[API Development](/categories/api)

kayschima/deutsche-bahn
=======================

Laravel package for Deutsche Bahn timetables

v1.0.1(4y ago)07MITPHP

Since Oct 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kayschima/deutsche-bahn)[ Packagist](https://packagist.org/packages/kayschima/deutsche-bahn)[ Docs](https://github.com/kayschima/deutsche-bahn)[ RSS](/packages/kayschima-deutsche-bahn/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

Deutsche Bahn Timetables
========================

[](#deutsche-bahn-timetables)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c6af08795d170fc9c3b511d248be5fb362ba5b9d7f18f5a446c740793fe88250/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6179736368696d612f64657574736368652d6261686e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kayschima/deutsche-bahn)[![Total Downloads](https://camo.githubusercontent.com/c875ca3dc2a28d4c2429b933a0932957c5b2429dd899cd991ab83a4b10dd0310/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6179736368696d612f64657574736368652d6261686e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kayschima/deutsche-bahn)[![Build Status](https://camo.githubusercontent.com/623700ae30147703533d7fd92c47a27871787a12fc038755c4a59f7177951fca/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6b6179736368696d612f64657574736368652d6261686e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/kayschima/deutsche-bahn)

"Deutsche Bahn" is a laravel package for timetables of german railway stations

Installation
------------

[](#installation)

Via Composer

```
$ composer require kayschima/deutsche-bahn
```

Publish the config file

```
$ php artisan vendor:publish --provider "Kayschima\DeutscheBahn\DeutscheBahnServiceProvider"
```

Usage
-----

[](#usage)

The usage of the package is quite simple:

- Get you API token at ().
- Fetch and install this package via Composer
- Set your API token in your .env file:

```
DEUTSCHE_BAHN_API_TOKEN=YOUR_API_TOKEN
```

### Facade

[](#facade)

You can use three different functions in this package:

```
use Kayschima\DeutscheBahn\Facades\DeutscheBahn;

$arrivals = DeutscheBahn::getArrivals('8000050', new DateTime('now'),true);
$departures = DeutscheBahn::getDepartures('8000050', new DateTime('now'), false);
$trainDetails = DeutscheBahn::getDetails('8000050hewrl7127871329172023440423023lhlhllklhlh50');
```

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

[](#artisan-command)

This package also provides an artisan coommand to get the id of a certain railway station of Deutsche Bahn.

```
php artisan deutsche-bahn:railway-station
```

Just answer the question about the desired train station and a number of possible IDs will be displayed.

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Kay Markschies](https://github.com/kayschima)
- [All Contributors](../../contributors)

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~195 days

Total

4

Last Release

1543d ago

Major Versions

v0.0.2 → v1.0.02020-10-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43473477?v=4)[Kay Markschies](/maintainers/kayschima)[@kayschima](https://github.com/kayschima)

---

Top Contributors

[![kayschima](https://avatars.githubusercontent.com/u/43473477?v=4)](https://github.com/kayschima "kayschima (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

apilaraveldbdeutschetimetablesbahnFahrpläne

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kayschima-deutsche-bahn/health.svg)

```
[![Health](https://phpackages.com/badges/kayschima-deutsche-bahn/health.svg)](https://phpackages.com/packages/kayschima-deutsche-bahn)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
