Download the PHP package cheesytech/booking without Composer
On this page you can find all versions of the php package cheesytech/booking. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cheesytech/booking
More information about cheesytech/booking
Files in cheesytech/booking
Package booking
Short Description A flexible and powerful booking system for Laravel applications
License MIT
Homepage https://github.com/cheesytech/booking
Informations about the package booking
Laravel Booking
A flexible and powerful booking system for Laravel applications that supports polymorphic relationships, time slot management, and advanced status tracking.
Features
- ๐ Time slot management with overlap prevention
- ๐ Polymorphic relationships for bookable and bookerable resources
- โ๏ธ Configurable validation and overlap rules
- ๐ฏ Custom booking rules via OverlapRule interface
- ๐ Business hours and custom rules validation
- ๐ Booking duration and minimum interval limits
- ๐จ Easy to extend with traits and interfaces
- ๐ Status tracking with full history and metadata
- ๐ Event-driven architecture (BookingCreated, BookingUpdated, etc.)
- ๐งช Comprehensive testing support and model factories
- ๐ Advanced querying and duration-based scopes (cross-DB)
- ๐พ Multi-database support (MySQL, PostgreSQL, SQLite, SQL Server)
- โฑ๏ธ Flexible duration calculations (minutes, hours, days)
- ๐ ๏ธ Publishable config and migration files
Requirements
- PHP 8.1 or higher
- Laravel 10.0, 11.0, 12.0, or 13.0
- Carbon 2.0 or higher
Installation
-
Install the package via composer:
-
The package will automatically register its service provider.
-
Publish and run the migrations:
- Publish the configuration file:
Or use the install command for all at once:
This will create a config/booking.php file in your config directory.
Configuration
The package is highly configurable through the config/booking.php file. Example:
Model Setup
Implement the provided interfaces and use the traits for your models:
Quick Start
Traits & Interfaces
- HasBookings: Add to bookable models (e.g., Room) for convenient booking management (
newBooking,deleteBooking, etc.). - HasBookers: Add to bookerable models (e.g., User) for managing bookings made by the entity.
- Bookable: Interface for resources to be booked (must implement
getBookableId,getBookableType). - Bookerable: Interface for entities making bookings (must implement
getBookerableId,getBookerableType). - OverlapRule: Interface for custom overlap validation rules.
Database Schema
The package creates the following database table:
Advanced Usage
Query Scopes
Status Management
Overlap & Custom Rules
- Prevents overlapping bookings by default.
- Supports minimum interval and max duration.
- Add custom rules by implementing
OverlapRuleand registering in config. - Example: BusinessHoursRule restricts bookings to business hours.
Events
Events are fired for all major actions:
- BookingCreated
- BookingUpdated
- BookingDeleted
- BookingStatusChanged
Testing & Factories
Use provided factories for testing:
Updating PHPDoc
To update PHPDoc for models, run:
Contributing
Thank you for considering contributing to the Laravel Booking package! Please feel free to submit pull requests or create issues for bugs and feature requests.
License
The Laravel Booking package is open-sourced software licensed under the MIT license.
All versions of booking with dependencies
laravel/framework Version ^10.0 || ^11.0 || ^12.0 || ^13.0
nesbot/carbon Version ^2.0 || ^3.0
spatie/laravel-package-tools Version ^1.92