PHPackages                             inshore/laravel-bookwhen - 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. inshore/laravel-bookwhen

ActivePackage[API Development](/categories/api)

inshore/laravel-bookwhen
========================

Bookwhen API SDK providing plug &amp; play access to the Bookwhen booking platform inside you Laravel application.

0.2.0(3y ago)272[1 PRs](https://github.com/inshore/laravel-bookwhen/pulls)MITBladeCI passing

Since May 1Pushed 3mo ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (7)Used By (0)

inShore.je - Laravel Bookwhen PHP API SDK
=========================================

[](#inshoreje---laravel-bookwhen-php-api-sdk)

[![Latest Version](https://camo.githubusercontent.com/fc65f5568a1d13637e6b560e9d8611236c59229eb0cc694dc5831b3fd60a33ab/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696e73686f72652f6c61726176656c2d626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/inshore/laravel-bookwhen/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Coverage Status](https://camo.githubusercontent.com/f2caa45a441581d04a4dcbf0ba0780089a39ffd8f8306b44725f85a85dc9d9a1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696e73686f72652f6c61726176656c2d626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/inshore/laravel-bookwhen/code-structure)[![Quality Score](https://camo.githubusercontent.com/d46b60c2b47af5d8013aecbc783f47d7c537e1f50ed931e207e179fde5df8793/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e73686f72652f6c61726176656c2d626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/inshore/laravel-bookwhen)[![Total Downloads](https://camo.githubusercontent.com/81e5da15394a861590d21e340c6434fc800f33f8be9e3b1a50f8ff6cd5c5dff1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e73686f72652f6c61726176656c2d626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inshore/laravel-bookwhen)

Laravel SDK kit for the Bookwhen API.

Install
-------

[](#install)

### Requirements

[](#requirements)

PHP 8.1 and later.

**Composer**

```
$ composer require inshore/laravel-bookwhen
```

Usage
-----

[](#usage)

Firstly ensure that the config and other items have been published by running vendor:publish

```
php artisan vendor:publish
```

Select the InShore\\Bookwhen\\ServiceProvider option.

```
  Provider: InShore\Bookwhen\ServiceProvider .....................................................................................................
```

Now simply add your Bookwhen API key to your .env

```
BOOKWHEN_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxx"

```

You can then check evberything is working by going to  in your browser or as per your setup.

Beyond this to actually access your Bookwhen data include the Booikwhen facade.

```
use InShore\Bookwhen\Facades\Bookwhen;
```

Then use as follows...

### Attachments

[](#attachments)

implements

Attachments

```
// Fetch attachments accessible by the API token.

$attachments = Bookwhen::attachments());
```

**Filters**

The filter parameters can be passed in as function parameters.

**title** - Filter on the file title text.

**fileName** - Filter on the file name.

**fileType** - Filter on the file type.

```
// Fetch attachments accessible by the API token.

$attachments = Bookwhen::attachments(fileName: 'CV'));

$attachments = Bookwhen::attachments(fileType: 'pdf'));

$attachments = Bookwhen::attachments(title: 'Title to filter by'));

$attachments = Bookwhen::attachments(fileName: 'CV', fileType: 'pdf', title: 'Title to filter by'));
```

Attachment

[https://api.bookwhen.com/v2#tag/Attachment/paths/1attachments1%7Battachment\_id%7D/g](https://api.bookwhen.com/v2#tag/Attachment/paths/~1attachments~1%7Battachment_id%7D/get)

```
// Returns the attachment for the provided attachment ID.

$attachment = Bookwhen::attachment('ev-smij-20200530100000' );

```

\###Class Passes

implements

ClassPasses

[https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class\_passes/get](https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class_passes/get)

```
// Fetch class passes accessible by the API token.

$classPasses = Bookwhen::classPasses());
```

**Filters**

The filter parameters can be passed in as function parameters

**title** - Filter on the title text of the pass.

**detail** - Filter on the details text.

**usageType** - Filter on the type of the pass: personal or any.

**cost** - Filter on the cost with an exact value or use a comparison operator. e.g. filter\[cost\]\[gte\]=2000

**gt** - greater than

**gte** - greater than or equal

**lt** - less than

**lte** - less than or equal

**eq** - equal to

**usageAllowance** - Filter on pass usage allowance. This also accepts a comparison operator like cost.

**useRestrictedForDays** - Filter on pass days restriction. This also accepts a comparison operator like cost.

```
// Fetch class passes accessible by the API token.

$classPasses = Bookwhen::classPasses());

$classPasses = Bookwhen::classPasses(title: 'Title to filter by'));
```

ClassPass

[https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class\_passes~1%7Bclass\_pass\_id%7D/get](https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class_passes~1%7Bclass_pass_id%7D/get)

```
// Returns the class pass for the provided class pass ID.

$classPass = Bookwhen::classPass('ev-smij-20200530100000');
```

### Events

[](#events)

Events

```
// Returns the event for the provided event ID.

$event = Bookwhen::events();
```

**Filters**

**calendar** - Restrict to events on the given calendars (schedule pages).

**entry** - Restrict to given entries.

**location** - Array of location slugs to include.

**tag** - Array of tag words to include.

**title** - Array of entry titles to search for.

**detail** - Array of entry details to search for.

**from** - Inclusive time to fetch events from in format YYYYMMDD or YYYYMMDDHHMISS. Defaults to today.

**to** - Non-inclusive time to fetch events until in format YYYYMMDD or YYYYMMDDHHMISS

**compact** - Boolean: Combine events in a course into a single virtual event.

**Includes**

By default the event will NOT have its attachments, location and tickets populated.

To retrieve an event with the included relationships, simply pass boolean true for the relationship that is required.

includeAttachments includeLocation includeTickets includeTickets.class\_passes includeTickets.events

for example to retrieve the event with its location and tickets.

```
// Returns the event for the provided event ID.

$event = Bookwhen::events(title: 'Title to filter by'));
```

Event

[https://api.bookwhen.com/v2#tag/Event/paths/1events1%7Bevent\_id%7D/get](https://api.bookwhen.com/v2#tag/Event/paths/~1events~1%7Bevent_id%7D/get)

```
// Returns the event for the provided event ID.

$event = Bookwhen::event('ev-smij-20200530100000');
```

**Filters**

The event list can be filtered as per the api documentation

**Includes**

By default the event will NOT have its attachments, location and tickets populated.

To retrieve an event withg the included relationships, simply pass boolean true for the relationship that is required.

**includeAttachments****includeLocation****includeTickets.class\_passes****includeTickets.events**

for example to retrieve the event with its location and tickets.

```
// Returns the event for the provided event ID.

$event = Bookwhen::event(eventId: 'ev-smij-20200530100000', includeLocation: true, includeTickets: true);
```

### Locations

[](#locations)

Implements

Locations

```
// Fetch events accessible by the API token.

$locations = Bookwhen::locations());

// Returns the location for the provided location ID.
```

**Filters**

**addressText** - Restrict to locations containing the address text filter.

**additionalInfo** - Filter by the text contained in the additional info.

```
// Fetch events accessible by the API token.

$locations = Bookwhen::locations(addressText: 'Remote'));

// Returns the location for the provided location ID.
```

Location

[https://api.bookwhen.com/v2#tag/Location/paths/1locations1%7Blocation\_id%7D/get](https://api.bookwhen.com/v2#tag/Location/paths/~1locations~1%7Blocation_id%7D/get)

```
// Returns the location for the provided location ID.

$location = Bookwhen::location('ev-smij-20200530100000');
```

### Tickets

[](#tickets)

Implements

Tickets

```
// Fetch tickets for the given event.

$eventId = 'ev-smij-20200530100000';

$client->tickets($eventId);
```

**Includes**

By default the tickets will NOT have its attachments, evetns and location populated.

To retrieve an event withg the included relationships, simply pass boolean true for the relationship that is required.

**includeAttachments****includeLocation****includeTickets.class\_passes****includeTickets.events**

```
// Fetch tickets for the given event.

$eventId = 'ev-smij-20200530100000';

$client->tickets($eventId, includeAttachments: true);
```

Ticket

[https://api.bookwhen.com/v2#tag/Ticket/paths/1tickets1%7Bticket\_id%7D/get](https://api.bookwhen.com/v2#tag/Ticket/paths/~1tickets~1%7Bticket_id%7D/get)

```
// Retrieve a single ticket.

$ticketId = 'ti-sboe-20200320100000-tk1m';

$client->ticket($ticketId);
```

**Includes**

By default the tickets will NOT have its attachments, evetns and location populated.

To retrieve an event withg the included relationships, simply pass boolean true for the relationship that is required.

**includeAttachments****includeLocation****includeTickets.class\_passes****includeTickets.events**

```
// Retrieve a single ticket.

$client->ticket('ti-sboe-20200320100000-tk1m', includeAttachments: true););
```

Logging
-------

[](#logging)

Full syslog level logging is available and can be enabled by passing a level in when instatiating the Client. As illustrated in RFC 5424 which describes the syslog protocol, the following levels of intensity are applied.

DEBUG: Detailed debugging information. INFO: Handles normal events. Example: SQL logs NOTICE: Handles normal events, but with more important events WARNING: Warning status, where you should take an action before it will become an error. ERROR: Error status, where something is wrong and needs your immediate action CRITICAL: Critical status. Example: System component is not available ALERT: Immediate action should be exercised. This should trigger some alerts and wake you up during night time. EMERGENCY: It is used when the system is unusable.

$bookwhen = new Bookwhen()-&gt;debug('Debug');

Testing
-------

[](#testing)

WIP

```
$ composer phpunit
```

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

[](#contributing)

Please see  for details.

Support
-------

[](#support)

If you require assistance with this package or implementing in your own project or business...

[https://bookwhen.com/inshore](https://bookwhen.com/laravel-inshore)

&lt;script type="text/javascript" src="" data-name="bmc-button" data-slug="danielmullin" data-color="#FFDD00" data-emoji="" data-font="Cookie" data-text="Buy me a coffee" data-outline-color="#000000" data-font-color="#000000" data-coffee-color="#ffffff" &gt;&lt;/script&gt;

Credits
-------

[](#credits)

- Daniel Mullin
- Brandon Lubbehusen

License
-------

[](#license)

MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance54

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 57.8% 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 ~0 days

Total

2

Last Release

1107d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/202db53ddb1a96b03c7e616979d2471db2ccee110afd161f0cd7115336a975c4?d=identicon)[inshore](/maintainers/inshore)

---

Top Contributors

[![blubbehusen](https://avatars.githubusercontent.com/u/55593324?v=4)](https://github.com/blubbehusen "blubbehusen (59 commits)")[![danielmullin](https://avatars.githubusercontent.com/u/1116873?v=4)](https://github.com/danielmullin "danielmullin (32 commits)")[![inshore](https://avatars.githubusercontent.com/u/68851391?v=4)](https://github.com/inshore "inshore (11 commits)")

---

Tags

booking-systembookwhenlaravellaravel-packagephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/inshore-laravel-bookwhen/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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