Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-04-30 (5 months ago) | Not enough user ratings | Total: 6 | All time: 11,444 This week: 73 |
Version | License | PHP version | Categories | |||
laravel-bookwhen 1.0 | Custom (specified... | 5 | PHP 5, Web services |
Description | Author | |
This package can Provide an API to access Bookwhen API services. |
Laravel SDK kit for the Bookwhen API.
https://www.bookwhen.com
https://api.bookwhen.com/v2
PHP 8.1 and later.
Composer
$ composer require inshore/laravel-bookwhen
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 http://localhost:8000/bookwhen/ 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...
implements https://api.bookwhen.com/v2#tag/Attachment
Attachments
https://api.bookwhen.com/v2#tag/Attachment/paths/~1attachments/get
// 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/~1attachments~1%7Battachment_id%7D/g
// Returns the attachment for the provided attachment ID.
$attachment = Bookwhen::attachment('ev-smij-20200530100000' );
implements https://api.bookwhen.com/v2#tag/ClassPass
ClassPasses
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
// Returns the class pass for the provided class pass ID.
$classPass = Bookwhen::classPass('ev-smij-20200530100000');
https://api.bookwhen.com/v2#tag/Event
Events
https://api.bookwhen.com/v2#tag/Event/paths/~1events/get
// 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/~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);
Implements https://api.bookwhen.com/v2#tag/Location
Locations
https://api.bookwhen.com/v2#tag/Location/paths/~1locations/get
// 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/~1locations~1%7Blocation_id%7D/get
// Returns the location for the provided location ID.
$location = Bookwhen::location('ev-smij-20200530100000');
Implements https://api.bookwhen.com/v2#tag/Ticket
Tickets
https://api.bookwhen.com/v2#tag/Ticket/paths/~1tickets/get
// 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/~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););
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()->debug('Debug');
WIP
$ composer phpunit
Please see https://github.com/inshore/laravel-bookwhen/blob/main/CONTRIBUTING.md for details.
If you require assistance with this package or implementing in your own project or business...
<script type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js" 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" ></script>
https://www.buymeacoffee.com/danielmullin
MIT
https://github.com/inshore/laravel-bookwhen/blob/main/LICENSE.md
Files (34) |
File | Role | Description | ||
---|---|---|---|---|
config (1 file) | ||||
resources (1 directory) | ||||
routes (1 file) | ||||
src (1 file, 2 directories) | ||||
tools (1 directory) | ||||
.env | Data | Auxiliary data | ||
.php-cs-fixer.php | Example | Example script | ||
.project | Data | Auxiliary data | ||
.scrutinizer.yml | Data | Auxiliary data | ||
CODE_OF_CONDUCT.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
CONTRIBUTING.md | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files (34) | / | resources | / | views |
File | Role | Description | ||
---|---|---|---|---|
attachments (2 files) | ||||
class-passes (2 files) | ||||
events (2 files) | ||||
locations (2 files) | ||||
tickets (2 files) | ||||
bookwhen.blade.php | Aux. | Auxiliary script | ||
index.blade.php | Aux. | Auxiliary script |
Files (34) | / | resources | / | views | / | attachments |
File | Role | Description |
---|---|---|
index.blade.php | Aux. | Auxiliary script |
show.blade.php | Aux. | Auxiliary script |
Files (34) | / | resources | / | views | / | class-passes |
File | Role | Description |
---|---|---|
index.blade.php | Aux. | Auxiliary script |
show.blade.php | Aux. | Auxiliary script |
Files (34) | / | resources | / | views | / | events |
File | Role | Description |
---|---|---|
index.blade.php | Aux. | Auxiliary script |
show.blade.php | Aux. | Auxiliary script |
Files (34) | / | resources | / | views | / | locations |
File | Role | Description |
---|---|---|
index.blade.php | Aux. | Auxiliary script |
show.blade.php | Aux. | Auxiliary script |
Files (34) | / | resources | / | views | / | tickets |
File | Role | Description |
---|---|---|
index.blade.php | Aux. | Auxiliary script |
show.blade.php | Aux. | Auxiliary script |
Files (34) | / | src |
File | Role | Description | ||
---|---|---|---|---|
Facades (1 file) | ||||
Http (1 directory) | ||||
ServiceProvider.php | Class | Class source |
Files (34) | / | src | / | Http | / | Controllers |
File | Role | Description |
---|---|---|
AttachmentController.php | Class | Class source |
BookwhenController.php | Class | Class source |
ClassPassController.php | Class | Class source |
EventController.php | Class | Class source |
LocationController.php | Class | Class source |
TicketController.php | Class | Class source |
Files (34) | / | tools | / | php-cs-fixer |
File | Role | Description |
---|---|---|
composer.json | Data | Auxiliary data |
composer.lock | Data | Auxiliary data |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.