PHPackages                             oltrematica/laravel-parking-hub - 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. oltrematica/laravel-parking-hub

ActiveLibrary[API Development](/categories/api)

oltrematica/laravel-parking-hub
===============================

Laravel Parking Hub package provides a standardized interface for interacting with various parking service APIs within a Laravel application. It defines Data Transfer Objects (DTOs) to ensure consistent data structures for parking validation responses, including status, validity, and expiration details.

v0.2.0(3mo ago)1526[5 PRs](https://github.com/Oltrematica/laravel-parking-hub/pulls)1MITPHPPHP ^8.3CI passing

Since May 20Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Oltrematica/laravel-parking-hub)[ Packagist](https://packagist.org/packages/oltrematica/laravel-parking-hub)[ RSS](/packages/oltrematica-laravel-parking-hub/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (32)Versions (15)Used By (1)

[![GitHub Tests Action Status](https://github.com/Oltrematica/laravel-parking-hub/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Oltrematica/laravel-parking-hub/actions/workflows/run-tests.yml/badge.svg)[![GitHub PhpStan Action Status](https://github.com/Oltrematica/laravel-parking-hub/actions/workflows/phpstan.yml/badge.svg)](https://github.com/Oltrematica/laravel-parking-hub/actions/workflows/phpstan.yml/badge.svg)[![Latest Version on Packagist](https://camo.githubusercontent.com/b6a408b6df095dfcb534905ffbfea558833b802658439ebc7842c78493b97912/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6c7472656d61746963612f6c61726176656c2d7061726b696e672d6875622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oltrematica/laravel-parking-hub)[![Total Downloads](https://camo.githubusercontent.com/1a42b551213fa1086c04e6f090db68aacdca592805474fe990ea67e6da6b0f30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6c7472656d61746963612f6c61726176656c2d7061726b696e672d6875622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oltrematica/laravel-parking-hub)

Laravel ParkingHub
==================

[](#laravel-parkinghub)

[![](https://private-user-images.githubusercontent.com/1971953/445694468-3e57322c-204d-4fb2-a89e-02609fe67fa3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODE2NzQwNTQsIm5iZiI6MTc4MTY3Mzc1NCwicGF0aCI6Ii8xOTcxOTUzLzQ0NTY5NDQ2OC0zZTU3MzIyYy0yMDRkLTRmYjItYTg5ZS0wMjYwOWZlNjdmYTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDYxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA2MTdUMDUyMjM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDJkMDQ0MjllZDA2YmI4NWM2NDVmNjhkNGQxMWIyMmE3YmMzMjYyOTgyYTRhMGJiNWIxYTAyMGY1MjQxOTc3MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.EOvivML38-QkISttZPsS7avkKnjwRebsa4N1r4uUcro)](https://private-user-images.githubusercontent.com/1971953/445694468-3e57322c-204d-4fb2-a89e-02609fe67fa3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODE2NzQwNTQsIm5iZiI6MTc4MTY3Mzc1NCwicGF0aCI6Ii8xOTcxOTUzLzQ0NTY5NDQ2OC0zZTU3MzIyYy0yMDRkLTRmYjItYTg5ZS0wMjYwOWZlNjdmYTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDYxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA2MTdUMDUyMjM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDJkMDQ0MjllZDA2YmI4NWM2NDVmNjhkNGQxMWIyMmE3YmMzMjYyOTgyYTRhMGJiNWIxYTAyMGY1MjQxOTc3MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.EOvivML38-QkISttZPsS7avkKnjwRebsa4N1r4uUcro)`laravel-parking-hub` is a Laravel package designed to create a unified and consistent way to interact with different parking service APIs (e.g., Parkeon, My Cicero). It aims to standardize the input and output of parking validation requests, making it easier to integrate and manage multiple parking providers.

Key features:
-------------

[](#key-features)

- **Standardized Data Transfer Objects (DTOs)**: Defines DTOs for representing standard responses from parking service APIs, ensuring consistency across different providers.
- **Unified Interface**: Provides a common interface for executing parking validation requests (e.g., checking license plates) across different services.
- **Response Standardization**: Standardizes the response format, including status (success/error), parking validity, and expiration details.
- **Easy Integration**: Simplifies the integration of new parking service providers by providing a clear structure for data mapping and response handling.

Prerequisites
-------------

[](#prerequisites)

- Laravel v10, v11 and v12
- PHP 8.3 or higher

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

[](#installation)

```
composer require oltrematica/laravel-parking-hub
```

Usage Guide
===========

[](#usage-guide)

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

[](#configuration)

1. **Publish the configuration file**: To customize the default configuration, publish the `parking-hub.php` config file using the following Artisan command:

    ```
    php artisan vendor:publish --provider="Oltrematica\\ParkingHub\\ParkingHubServiceProvider" --tag="parking-hub-config"
    ```

    This will create a `config/parking-hub.php` file in your application's config directory.
2. **Configure Your Drivers**: Open the `config/parking-hub.php` file. Here you can define and configure your parking drivers.

    - **Default Driver**: Set the `default_driver` option to specify the driver to be used when no driver is explicitly chosen.

        ```
        'default_driver' => env('PARKING_HUB_DEFAULT_DRIVER', 'easypark'),
        ```
    - **Driver Settings**: Under the `drivers` array, configure each provider. Each driver configuration must include a `class` key, which specifies the class that implements the `Oltrematica\\ParkingHub\\Contracts\\ParkingValidator` interface. You will also add provider-specific settings like API keys, endpoints, etc.

        ```
        'drivers' => [
            'easypark' => [
                'class' => YourVendor\\LaravelEasyPark\\EasyParkValidator::class, // Replace with the actual validator class
                'api_url' => env('EASYPARK_API_URL', 'https://cityname.parkinghub.net/restresources'),
                'username' => env('EASYPARK_USERNAME'),
                'password' => env('EASYPARK_PASSWORD'),
                // other configuration options specific to EasyPark
            ],

            'mycicero' => [
                'class' => YourVendor\\LaravelMyCicero\\MyCiceroValidator::class, // Replace with the actual validator class
                'username' => env('MYCICERO_USERNAME'),
                'password' => env('MYCICERO_PASSWORD'),
                'soap' => [
                    'endpoint' => env('MYCICERO_SOAP_ENDPOINT', 'https://cldweb.autobus.it/proxy.imomo/api/wsisosta_verifica'),
                    'namespace' => env('MYCICERO_SOAP_NAMESPACE', 'http://pluservice.net/ISosta'),
                    // ... other MyCicero specific SOAP settings
                ],
            ],

            'parkeon' => [
                'class' => Oltrematica\\ParkingHub\\Validators\\ParkeonValidator::class, // Example, replace with actual
                'username' => env('PARKEON_USERNAME'),
                'password' => env('PARKEON_PASSWORD'),
                'endpoint' => env('PARKEON_ENDPOINT', 'https://parkeon.services/jlab/rest/1/pbs/getTransactions'),
                // other configuration options specific to Parkeon
            ],

            // Add other parking providers here
        ],
        ```

    Ensure you have the necessary environment variables (e.g., `EASYPARK_USERNAME`, `MYCICERO_PASSWORD`) set in your `.env` file.

Basic Usage
-----------

[](#basic-usage)

You can interact with the parking drivers through the `ParkingHub` facade or by resolving the manager from the service container.

### Using the Facade

[](#using-the-facade)

```
use Oltrematica\\ParkingHub\\Facades\\ParkingHub;
use Carbon\\Carbon;

// Check plate using the default driver
$response = ParkingHub::checkPlate('AA123BB', Carbon::now());

// Check plate using a specific driver
$responseEasypark = ParkingHub::driver('easypark')->checkPlate('AA123BB', Carbon::now());
$responseMyCicero = ParkingHub::driver('mycicero')->checkPlate('CC456DD', Carbon::now());

// The $response will be an instance of Oltrematica\ParkingHub\DTOs\ParkingValidationResponseData
if ($response->isValid) {
    // Parking is valid
    echo "Plate {$response->plate} parking is valid. Ends at: " . ($response->parkingEndTime ? $response->parkingEndTime->format('Y-m-d H:i:s') : 'N/A');
} else {
    // Parking is not valid or an error occurred
    echo "Plate {$response->plate} parking is not valid. Status: {$response->responseStatus->value}";
}
```

### Resolving from the Container

[](#resolving-from-the-container)

```
use Oltrematica\\ParkingHub\\Support\\Manager\\ParkingHubManager;
use Carbon\\Carbon;

// Resolve the manager
$parkingHubManager = app(ParkingHubManager::class);

// Check plate using the default driver
$response = $parkingHubManager->driver()->checkPlate('AA123BB', Carbon::now());

// Check plate using a specific driver
$responseParkeon = $parkingHubManager->driver('parkeon')->checkPlate('EE789FF', Carbon::now());
```

Understanding the Response
--------------------------

[](#understanding-the-response)

The `checkPlate` method returns a `Oltrematica\ParkingHub\DTOs\ParkingValidationResponseData` object. This DTO contains the following properties:

- `responseStatus`: An enum (`Oltrematica\ParkingHub\Enums\ProviderInteractionStatus`) indicating the outcome of the interaction with the provider (e.g., `SUCCESS`, `ERROR_PROVIDER_UNREACHABLE`, `ERROR_INVALID_CREDENTIALS`).
- `plate`: The license plate number checked.
- `requestTimestamp`: A `CarbonInterface` object representing when the request was initiated.
- `verificationTimestamp`: A `CarbonInterface` object representing the date and time for which parking validity was checked.
- `isValid`: A boolean indicating if the parking is valid for the given `verificationTimestamp`.
- `parkingEndTime`: A `CarbonInterface` object indicating when the parking expires, or `null` if not applicable or unknown.
- `purchasedParkings`: An array of `Oltrematica\ParkingHub\DTOs\PurchasedParkingData` objects, providing details of active parking sessions if available from the provider. Each `PurchasedParkingData` object has `startDateTime` and `endDateTime`.

Adding a New Driver
-------------------

[](#adding-a-new-driver)

To add support for a new parking service provider:

1. **Create a Validator Class**: Implement the `Oltrematica\ParkingHub\Contracts\ParkingValidator` interface. This class will handle the interaction with the provider's API. The `checkPlate` method should:

    - Accept the license plate number and verification date/time as parameters.
    - Handle API response (success, errors, authentication issues).
    - Map the provider's response to the fields of `ParkingValidationResponseData`.

    Example (replace with actual API interaction and mapping logic):

    ```
    public function checkPlate(string $plateNumber, CarbonInterface $verificationDateTime): ParkingValidationResponseData
    {
        $requestTimestamp = now();

        // Simulate an API call that finds a valid parking
        $isValid = false; // Determine from API response
        $parkingEndTime = null; // Determine from API response
        $purchasedParkings = []; // Populate if provider returns multiple active parkings
        $responseStatus = ProviderInteractionStatus::SUCCESS; // Set based on API interaction outcome

        if ($plateNumber === 'VALID123') {
            $isValid = true;
            $parkingEndTime = $verificationDateTime->copy()->addHours(2);
            $purchasedParkings[] = new \Oltrematica\ParkingHub\DTOs\PurchasedParkingData(
                startDateTime: $verificationDateTime->copy()->subHour(),
                endDateTime: $parkingEndTime
            );
        } elseif ($plateNumber === 'APIERROR') {
            $responseStatus = ProviderInteractionStatus::ERROR_PROVIDER_SPECIFIC;
        }

        return new ParkingValidationResponseData(
            responseStatus: $responseStatus,
            plate: $plateNumber,
            requestTimestamp: $requestTimestamp,
            verificationTimestamp: $verificationDateTime,
            isValid: $isValid,
            parkingEndTime: $parkingEndTime,
            purchasedParkings: $purchasedParkings
        );
    }
    ```
2. **Configure the New Driver**: Add its configuration to the `drivers` array in `config/parking-hub.php`:

    ```
    'drivers' => [
        // ... other drivers
        'your_new_driver' => [
            'class' => YourVendor\\YourPackage\\YourNewDriverValidator::class,
            'api_key' => env('YOUR_NEW_DRIVER_API_KEY'),
            'api_secret' => env('YOUR_NEW_DRIVER_API_SECRET'),
            // other necessary configuration
        ],
    ],
    ```
3. **Use the New Driver**:

    ```
    $response = ParkingHub::driver('your_new_driver')->checkPlate('XYZ789', Carbon::now());
    ```

Translations
------------

[](#translations)

This package includes translations for messages. To publish the translation files to your application's `lang/vendor` directory, use:

```
php artisan vendor:publish --provider="Oltrematica\\\\ParkingHub\\\\ParkingHubServiceProvider" --tag="oltrematica-parking-hub-translations"
```

You can then customize the translations in `lang/vendor/oltrematica-parking-hub/{locale}`.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. If this file does not exist, you can create one or refer to the main repository's contributing guidelines. For now, contributions can be made via Pull Requests on the [GitHub repository](https://github.com/Oltrematica/laravel-parking-hub).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within this package, please send an e-mail to . All security vulnerabilities will be promptly addressed. Alternatively, you can check the [security policy](https://github.com/Oltrematica/laravel-parking-hub/security/policy) on GitHub.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance83

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.2% 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 ~60 days

Recently: every ~76 days

Total

6

Last Release

108d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/143425497?v=4)[Oltrematica Srl](/maintainers/oltrematica)[@Oltrematica](https://github.com/Oltrematica)

---

Top Contributors

[![mirchaemanuel](https://avatars.githubusercontent.com/u/1971953?v=4)](https://github.com/mirchaemanuel "mirchaemanuel (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelutilitiesoltrematicaparking-hub

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/oltrematica-laravel-parking-hub/health.svg)

```
[![Health](https://phpackages.com/badges/oltrematica-laravel-parking-hub/health.svg)](https://phpackages.com/packages/oltrematica-laravel-parking-hub)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

8120.4k](/packages/danestves-laravel-polar)[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.

5022.0k](/packages/simplestats-io-laravel-client)[lettermint/lettermint-laravel

Official Lettermint driver for Laravel

1190.2k1](/packages/lettermint-lettermint-laravel)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)

PHPackages © 2026

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