PHPackages                             mjoc1985/fhr-laravel-client - 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. mjoc1985/fhr-laravel-client

ActiveLibrary[API Development](/categories/api)

mjoc1985/fhr-laravel-client
===========================

FHR API client (search, inventory, cart) for Laravel.

v1.0.0(1mo ago)01MITPHPPHP ^8.4CI passing

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/mjoc1985/fhr-laravel-client)[ Packagist](https://packagist.org/packages/mjoc1985/fhr-laravel-client)[ RSS](/packages/mjoc1985-fhr-laravel-client/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

FHR Client
==========

[](#fhr-client)

A standalone Laravel client for the **FHR API** — search, inventory, and cart/checkout for airport parking, lounges, and hotels.

A reusable, publishable package containing the low-level SDK only (HTTP client, DTOs, enums, exceptions). Application-specific concerns — syncing the catalogue into your database, pricing against your own products, persisting bookings — stay in your app and consume this package.

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 11 or 12

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

[](#installation)

```
composer require mjoc1985/fhr-laravel-client
```

The service provider is auto-discovered. Publish the config if you want to customise it:

```
php artisan vendor:publish --tag=fhr-config
```

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

[](#configuration)

All settings are environment-driven (`config/fhr.php`). The common ones:

```
FHR_API_URL=https://www.bookfhr.com/api
FHR_API_TOKEN=your-production-token
FHR_SOURCE_CODE=your-source-code
FHR_TENANT=your-tenant

# Sandbox (used when you request sandbox mode explicitly)
FHR_SANDBOX_API_URL=https://bookfhr.dev/api
FHR_SANDBOX_API_TOKEN=your-sandbox-token
FHR_SANDBOX_TENANT=your-sandbox-tenant

# Optional: route the client's logs to a dedicated channel (defaults to your app's default)
FHR_LOG_CHANNEL=fhr
```

Usage
-----

[](#usage)

### Search

[](#search)

```
use Mjoc1985\Fhr\Services\FhrSearchService;
use Carbon\Carbon;

$search = FhrSearchService::make();

$results = $search->searchParking(
    location: 'MAN',
    dateFrom: Carbon::parse('2026-08-01'),
    timeFrom: '10:00',
    dateTo: Carbon::parse('2026-08-08'),
    timeTo: '18:00',
);

$cheapest = $results->getCheapestProduct();
```

### Inventory

[](#inventory)

```
use Mjoc1985\Fhr\Services\FhrInventoryService;

$inventory = FhrInventoryService::make();
$product = $inventory->getParkingProduct(12345);
$lounge  = $inventory->getLoungeProduct(6789);
```

### Cart &amp; checkout

[](#cart--checkout)

```
use Mjoc1985\Fhr\Services\FhrCartService;

$cart = FhrCartService::make();
// build cart, add items, retrieve the FHR-hosted checkout URL, etc.
```

### Low-level client

[](#low-level-client)

```
use Mjoc1985\Fhr\FhrClient;

$client = FhrClient::make();               // production credentials
$sandbox = FhrClient::make(sandbox: true); // sandbox credentials

$response = $client->get('search', ['type' => 'Parking', /* ... */]);
```

Or resolve any of them from the container (`app(FhrClient::class)`), since the service provider binds them.

Sandbox vs production
---------------------

[](#sandbox-vs-production)

The package does not reach into your application's state to decide which credentials to use. **You** decide, and pass a boolean:

```
$client  = FhrClient::make(sandbox: $someAppFlag);
$search  = FhrSearchService::make(sandbox: $someAppFlag);
```

A common pattern is to bind these in your own service provider, resolving the flag from wherever your app keeps its "test mode":

```
$this->app->bind(FhrClient::class, fn () => FhrClient::make(sandbox: isTestMode()));
```

Logging API calls
-----------------

[](#logging-api-calls)

The client records each request/response through an `ApiLogger`. By default it uses a no-op (`NullApiLogger`), so nothing is persisted. To capture calls (e.g. to a database), implement the contract and bind it:

```
use Mjoc1985\Fhr\Contracts\ApiLogger;

class DatabaseApiLogger implements ApiLogger
{
    public function log(/* ... */): void
    {
        // persist however you like
    }
}

// in a service provider
$this->app->bind(ApiLogger::class, DatabaseApiLogger::class);
```

Testing
-------

[](#testing)

```
composer install
composer test      # Pest
composer lint      # Pint
composer analyse   # PHPStan (larastan)
```

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9640272?v=4)[Mike O'Connor](/maintainers/mjoc1985)[@mjoc1985](https://github.com/mjoc1985)

---

Top Contributors

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

---

Tags

laravelapi clienttravelparkingfhrlounges

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mjoc1985-fhr-laravel-client/health.svg)

```
[![Health](https://phpackages.com/badges/mjoc1985-fhr-laravel-client/health.svg)](https://phpackages.com/packages/mjoc1985-fhr-laravel-client)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

818355.4k3](/packages/defstudio-telegraph)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M238](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[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)[illuminate/auth

The Illuminate Auth package.

9328.5M1.4k](/packages/illuminate-auth)

PHPackages © 2026

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