Download the PHP package masterix21/laravel-bookings without Composer
On this page you can find all versions of the php package masterix21/laravel-bookings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download masterix21/laravel-bookings
More information about masterix21/laravel-bookings
Files in masterix21/laravel-bookings
Package laravel-bookings
Short Description Add bookings ability to any Eloquent model
License MIT
Homepage https://github.com/masterix21/laravel-bookings
Informations about the package laravel-bookings
Laravel Bookings
A comprehensive Laravel package that adds powerful booking functionality to any Eloquent model. Transform your models into bookable resources with advanced features like time-based reservations, capacity management, planning constraints, overlap detection, and event-driven architecture.
Features
- ๐ Make any Eloquent model bookable with simple traits
- ๐ Advanced time period management using Spatie Period library
- ๐ข Resource capacity control with configurable limits
- ๐ Planning constraints with weekday and time restrictions
- ๐ Overlap detection and conflict prevention
- ๐ฏ Event-driven architecture for audit trails and integrations
- ๐๏ธ Polymorphic relationships for flexible booker and resource types
- ๐งช Well tested with comprehensive test suite
- โก Performance optimized with efficient database queries
- ๐ก๏ธ Transaction safety with automatic rollback on failures
Installation
Install the package via Composer:
Publish and run the migrations:
Optionally, publish the config file:
Quick Start
1. Make a Model Bookable
Add the IsBookable
trait to any model you want to make bookable:
2. Create a Bookable Resource
3. Make a Booking
Core Concepts
BookableResource
The central entity that represents a bookable item. It's linked to your actual model (Room, Car, etc.) via polymorphic relationships.
Booking
Represents a reservation with metadata, booker information, and associated time periods.
BookedPeriod
Individual time slots within a booking, supporting complex multi-period reservations.
BookablePlanning
Defines availability rules, working hours, and constraints for resources.
Advanced Features
Planning Constraints
Define when resources are available:
Event System
Listen to booking lifecycle events:
Checking Availability
Overlap Detection
The package automatically prevents overlapping bookings:
Complete Examples
For comprehensive implementation examples, see:
- ๐จ Hotel Booking System - Complete hotel reservation system
- ๐ Car Rental System - Vehicle rental management
- ๐ฝ๏ธ Restaurant Reservations - Table booking system
- ๐ Service Appointments - Appointment scheduling
Documentation
For detailed documentation, see:
- โ๏ธ Configuration - Package configuration options
- ๐๏ธ Database Schema - Database structure and migrations
- ๐ API Reference - Complete API documentation
Key Topics
- ๐๏ธ Architecture - Package design and structure
- ๐ Getting Started - Quick start guide
- ๐ Models - Model relationships and usage
- โก Actions - Core booking operations
- ๐ฏ Events - Event system and listeners
- ๐งช Testing - Testing strategies and examples
- ๐ง Extending - Customization and extensions
- ๐จ Troubleshooting - Common issues and solutions
Legacy Quick Reference
For complete API documentation, see docs/api-reference.md
The package provides the following core traits and actions:
IsBookable
trait - Makes any model bookableHasBookings
trait - For entities that can make bookingsBookResource
action - Creates and updates bookingsCheckBookingOverlaps
action - Validates booking conflicts
Events are automatically fired during the booking lifecycle for audit trails and integrations.
Testing
Run the package tests:
Run tests with coverage:
Run static analysis:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Luca Longo
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-bookings with dependencies
illuminate/contracts Version ^12.0
kirschbaum-development/eloquent-power-joins Version ^4.2
nesbot/carbon Version ^3.8
spatie/laravel-package-tools Version ^1.92
spatie/period Version ^2.4
staudenmeir/belongs-to-through Version ^2.16
staudenmeir/eloquent-has-many-deep Version ^1.20