PHPackages                             zanardigit/bookable - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zanardigit/bookable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zanardigit/bookable
===================

A library to make other objects bookable

06PHP

Since Feb 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zanardigit/bookable)[ Packagist](https://packagist.org/packages/zanardigit/bookable)[ RSS](/packages/zanardigit-bookable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

bookable
========

[](#bookable)

A PHP library to make other objects bookable.

Description
-----------

[](#description)

My aim is to provide an independent library to make any other object bookable (i.e. rooms, theaters, cars, ...). I am using a kind of Decorator around the original object to provide additional features, without reimplementing all booking-related concepts in your application.

Status
------

[](#status)

2015-06-04: this is alpha code, never used anywhere except in the test suite, so if you're looking for something to use today, move on. But you can definitely play with it, or even use it if you're feeling brave and you want to implement the persistence part yourself.

Setup
-----

[](#setup)

This package is available on Packagist, so you can add it to your composer file with:

```
composer require zanardigit/bookable

```

Then you can add in your class

```
use Bookable

```

and you're ready to go.

Usage
-----

[](#usage)

### Create a bookable object

[](#create-a-bookable-object)

First of all, we assume you have an object already created in your code. Then you can pass it to the Bookable constructor, like this:

```
$bookable = new Bookable($myObject);

```

### Book an object

[](#book-an-object)

This will create a new booking for your object:

```
$result = $bookable->book(\DateTimeImmutable $begin, \DateTimeImmutable $end)

```

You can create as many as you want, as long as they do not overlap.

### Get bookings

[](#get-bookings)

This will return an array of bookings:

```
$bookings = $bookable->getBookings();

```

### Remove a booking

[](#remove-a-booking)

This will remove a specific booking, identified by its uuid

```
$result = $bookable->unbook(string $uuid)

```

This will remove a specific booking, identified by begin and end date

```
$result = $bookable->unbook(\DateTimeImmutable $begin, \DateTimeImmutable $end)

```

Persistence
-----------

[](#persistence)

The library itself may need to persist some data. To keep it flexible for use in different framework / CMS, I will delegate the actual persistence to a "driver" class that can use application-specific helper classes / methods.

Cooperation
-----------

[](#cooperation)

I strongly believe in open source as cooperation, in a not-reinventing-the-wheel sense. I searched through GitHub for similar packages but for PHP I only found an API client for [www.bookability.io](http://www.bookability.io), an online "bookable-as-a-service" solution, which is probably cool but not what I was looking for. You are free (and in fact encouraged) to point out similar solutions so that we may share the coding effort to the benefit of everyone.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d1bd87699f3ba41b076c7de9093de5f6819da717b2e634dd27b0d667bc77d09?d=identicon)[zanardigit](/maintainers/zanardigit)

### Embed Badge

![Health badge](/badges/zanardigit-bookable/health.svg)

```
[![Health](https://phpackages.com/badges/zanardigit-bookable/health.svg)](https://phpackages.com/packages/zanardigit-bookable)
```

PHPackages © 2026

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