PHPackages                             divino11/laravel-playtomic - 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. divino11/laravel-playtomic

ActiveLibrary[API Development](/categories/api)

divino11/laravel-playtomic
==========================

Laravel SDK for the Playtomic API — venue search, court availability, booking, and authentication.

v1.1.6(2mo ago)082↓33.3%MITPHPPHP ^8.2

Since Feb 9Pushed 2mo agoCompare

[ Source](https://github.com/divino11/laravel-playtomic)[ Packagist](https://packagist.org/packages/divino11/laravel-playtomic)[ RSS](/packages/divino11-laravel-playtomic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (11)Used By (0)

Laravel Playtomic
=================

[](#laravel-playtomic)

A Laravel SDK for the [Playtomic](https://playtomic.io) API — venue search, court availability, booking, and authentication.

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

[](#installation)

```
composer require divino11/laravel-playtomic
```

Laravel will auto-discover the service provider. To publish the configuration file:

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

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

[](#configuration)

Set the following environment variables (all optional — sensible defaults are provided):

VariableDefaultDescription`PLAYTOMIC_BASE_URL``https://api.playtomic.io/v1`API base URL`PLAYTOMIC_TIMEOUT``15`HTTP timeout in seconds`PLAYTOMIC_DEFAULT_RADIUS``50000`Venue search radius in metersUsage
-----

[](#usage)

### Search Venues

[](#search-venues)

```
use Divino11\Playtomic\Contracts\PlaytomicClientInterface;

$client = app(PlaytomicClientInterface::class);
$venues = $client->searchVenues(40.4168, -3.7038, 50000);
```

### Check Availability

[](#check-availability)

```
$slots = $client->getAvailability('tenant-id', '2026-02-10');
```

### Authentication (for bookings)

[](#authentication-for-bookings)

```
use Divino11\Playtomic\Contracts\PlaytomicAuthClientInterface;

$authClient = app(PlaytomicAuthClientInterface::class);
$tokens = $authClient->login('user@example.com', 'password');
```

### High-Level Service

[](#high-level-service)

```
use Divino11\Playtomic\Services\PlaytomicService;

$service = app(PlaytomicService::class);

// Search by location name (geocodes automatically)
$venues = $service->searchVenuesByLocation('Madrid');

// Get availability grouped by time slot
$grouped = $service->getGroupedAvailability('tenant-id', '2026-02-10');
```

### Book a Court

[](#book-a-court)

Booking requires authentication. The flow is: **create → update → confirm** a payment intent.

```
use Divino11\Playtomic\Contracts\PlaytomicAuthClientInterface;
use Divino11\Playtomic\DataTransferObjects\BookingRequestDto;

$authClient = app(PlaytomicAuthClientInterface::class);
$tokens = $authClient->login('user@example.com', 'password');

// 1. Create a payment intent
$request = new BookingRequestDto(
    tenantId: 'tenant-uuid',
    resourceId: 'court-resource-uuid',
    date: '2026-02-10',
    startTime: '10:00',
    duration: 90,           // minutes
    numberOfPlayers: 4,     // optional, defaults to 4
);

$paymentIntent = $authClient->createPaymentIntent(
    $tokens->accessToken,
    $request,
    $tokens->userId,
);

// 2. Update with payment method
$authClient->updatePaymentIntent(
    $tokens->accessToken,
    $paymentIntent->paymentIntentId,
    'WALLET',  // payment method
);

// 3. Confirm the booking
$result = $authClient->confirmPaymentIntent(
    $tokens->accessToken,
    $paymentIntent->paymentIntentId,
);

// $result is a BookingResultDto with: matchId, status, courtName, startDate, startTime, duration, price
```

### Get User Bookings

[](#get-user-bookings)

```
$bookings = $authClient->getUserMatches(
    $tokens->accessToken,
    $tokens->userId,
    size: 50,                    // optional, defaults to 50
    sort: 'start_date,DESC',    // optional
);

// Each booking is a UserBookingDto with: matchId, startDate, endDate, status, resourceName, price, tenantName, tenantCity
```

### Cancel a Booking

[](#cancel-a-booking)

```
// Cancel with default reason ('PERSONAL')
$authClient->cancelBooking($tokens->accessToken, 'match-id');

// Cancel with a specific reason code
$authClient->cancelBooking($tokens->accessToken, 'match-id', 'CANCELED_BY_OWNER');
```

### Book Multiple Courts

[](#book-multiple-courts)

Book several courts at once with automatic rollback if any booking fails:

```
use Divino11\Playtomic\Contracts\PlaytomicAuthClientInterface;
use Divino11\Playtomic\DataTransferObjects\BookingRequestDto;

$authClient = app(PlaytomicAuthClientInterface::class);
$tokens = $authClient->login('user@example.com', 'password');

$requests = [
    new BookingRequestDto('tenant-uuid', 'court-1-uuid', '2026-02-10', '10:00', 90),
    new BookingRequestDto('tenant-uuid', 'court-2-uuid', '2026-02-10', '10:00', 90),
    new BookingRequestDto('tenant-uuid', 'court-3-uuid', '2026-02-10', '10:00', 90),
];

// Books each court sequentially, cancels all if one fails
$result = $authClient->bookMultipleCourts(
    $tokens->accessToken,
    $requests,
    $tokens->userId,
    rollbackOnFailure: true, // set to false to keep successful bookings even if one fails
);

// $result is a MultiBookingResultDto
$result->allSucceeded;  // bool
$result->successful;    // BookingResultDto[]
$result->failed;        // BookingRequestDto[]
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance85

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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 ~2 days

Total

10

Last Release

76d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14139293?v=4)[divino11](/maintainers/divino11)[@divino11](https://github.com/divino11)

---

Top Contributors

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

---

Tags

apilaravelbookingplaytomicpadel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/divino11-laravel-playtomic/health.svg)

```
[![Health](https://phpackages.com/badges/divino11-laravel-playtomic/health.svg)](https://phpackages.com/packages/divino11-laravel-playtomic)
```

###  Alternatives

[essa/api-tool-kit

set of tools to build an api with laravel

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

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)[grazulex/laravel-apiroute

Complete API versioning lifecycle management for Laravel

1036.0k](/packages/grazulex-laravel-apiroute)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

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