PHPackages                             adewra/laravel-traffic-scotland - 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. adewra/laravel-traffic-scotland

ActiveLibrary[API Development](/categories/api)

adewra/laravel-traffic-scotland
===============================

Access Traffic Scotland's Current Incidents, Live Traffic Cameras, Unplanned Events, Roadworks, Future Roadworks, Traffic Status, Variable Message Signs and Journey Times.

v0.8.5(5y ago)254MITPHPPHP ^7.2CI failing

Since Dec 29Pushed 5y agoCompare

[ Source](https://github.com/Adewra/traffic-scotland)[ Packagist](https://packagist.org/packages/adewra/laravel-traffic-scotland)[ Docs](https://trafficscotland.adewra.com/)[ RSS](/packages/adewra-laravel-traffic-scotland/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (10)Versions (7)Used By (0)

Traffic Scotland
================

[](#traffic-scotland)

A package for retrieving the latest traffic information in Scotland through [Traffic Scotland](https://trafficscotland.org/).

Designed primarily for the Laravel &amp; Lumen frameworks, you can easily just drop this into any PHP project using Composer.

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Upgrading](#upgrading)
- [Testing](#testing)
- [Configuration](#configuration)
- [Troubleshooting](#troubleshooting)
- [Package Features](#troubleshooting)
- [Minimum Viable Product](#minimumviableproduct)
- [Examples](#examples)

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

[](#installation)

Installation using composer:

```
composer require adewra/traffic-scotland

```

### Laravel/Lumen version compatibility

[](#laravellumen-version-compatibility)

VersionStatus4.x.xUntested5.x.xUntested6.x.xUntested7.0Test BuildFor Lumen and Laravel versions earlier than `5.5` you'll also need to add the *service provider* in `config/app.php`:

```
Adewra\TrafficScotland\TrafficScotlandServiceProvider::class,
```

Upgrading
---------

[](#upgrading)

This package is still in `Pre-release`, upgrade instructions will come when the first update is officially released.

Testing
-------

[](#testing)

```
./vendor/bin/phpunit

```

Configuration
-------------

[](#configuration)

To publish the configuration file run:

```
> php artisan vendor:publish --tag=config --tag=migrations --tag=seeds

```

This will copy the configuration file to `config/trafficscotland.php`.

Here is an example (and the default) configuration:

```
    'functionality' => [
        'incidents' => true,
        'roadworks' => [
            'current' => true,
            'planned' => true,
        ],
        'events' => true,
    ],
    'collection_methods' => [
        'api' => true,
        'rss_feeds' => false,
        'webpage_scraping' => false,
    ],
    'storage' => true
```

To run our database migrations that allow for storing of the data:

```
php artisan migrate --path=/packages/adewra/trafficscotland/src/migrations

```

Troubleshooting
---------------

[](#troubleshooting)

Troubleshooting hasn't been written yet.

Package features
----------------

[](#package-features)

TypeIncludedConfigurationYesViewsNoBlade DirectivesNoCommandsYesMigrationsYesTranslationsNoMiddlewareNoEventsNoSeedsYesMVP &amp; potential future functionality
----------------------------------------

[](#mvp--potential-future-functionality)

- Incidents
- Roadworks (Current &amp; Planned)
- Events (&amp; Venues)
- Status/Congestion
- Traffic Cameras
- Queues
- Park and Ride
- Bulletins
- Weather Incidents
- Weather Stations
- Police Travel Warnings
- Variable Message Signs
- Highways England
- News
- Gritters

Methods
-------

[](#methods)

The preferred method for obtaining information is through Traffic Scotland's API that is utilised by the mobile version of their website.

Alternative methods include use of Datex II Service, RSS Feeds or through scraping the web pages.

Examples
--------

[](#examples)

**Retrieving Current Incidents**

```
  $incidents = TrafficScotland::incidents();
```

```
  php artisan trafficscotland:incidents

```

```
  php artisan tinker
  >>> Adewra\TrafficScotland\Incident::all();

```

**Retrieving Roadworks**

```
 $roadworks = TrafficScotland::roadworks(true, true);
```

```
 php artisan trafficscotland:roadworks

```

```
 php artisan tinker
 >>> Adewra\TrafficScotland\Roadwork::all();

```

**Retrieving Events**

```
 $roadworks = TrafficScotland::events();
```

```
 php artisan trafficscotland:events

```

```
 php artisan tinker
 >>> Adewra\TrafficScotland\Event::all();
 >>> Adewra\TrafficScotland\Venue::all();

```

Lessons Learned
---------------

[](#lessons-learned)

- My original choice of HTTP client Goutte isn't able to handle Traffic Scotland's website's javascript based navigation and as such, I should have gone with Selenium 2 from the beginning. Using Behat's Mink I am able to easily switch between both.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~41 days

Recently: every ~51 days

Total

6

Last Release

2121d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71ed183404db3ad7dab77001632a70b86cd840c1c65d6d17e6f733d4ca6da67c?d=identicon)[Adewra](/maintainers/Adewra)

---

Top Contributors

[![AlastairDewar](https://avatars.githubusercontent.com/u/35621?v=4)](https://github.com/AlastairDewar "AlastairDewar (122 commits)")

---

Tags

laravelbusroadstraffictrainScotlandsubwayferryferriesroadworksjourney timesvariable message signs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adewra-laravel-traffic-scotland/health.svg)

```
[![Health](https://phpackages.com/badges/adewra-laravel-traffic-scotland/health.svg)](https://phpackages.com/packages/adewra-laravel-traffic-scotland)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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