steelants / booking
Livewire booking calendar
Installs: 104
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Blade
Requires
- laravel/framework: ^11.0
- livewire/livewire: ^3.0
README
Created by: SteelAnts s.r.o.
Installation
composer require steelants/booking
Import assets
php artisan vendor:publish --tag=booking-assets
// app.scss @import "./vendor/booking/booking.scss";
// app.js import './vendor/booking/booking.js';
Usage
<?php namespace App\Livewire; use SteelAnts\Booking\Livewire\Calendar; class CustomCalendar extends Calendar { public function mount() { $this->renderType = 'freehand'; $this->dateFrom = date('Y-m-d', strtotime('today')); $this->dateTo = date('Y-m-d', strtotime('+7 days')); $this->selectedDay = date('Y-m-d', strtotime('today')); // required action $this->init(); } protected function loadSlots() { // demo return [ [ 'datetime_from' => date('Y-m-d 12:00:00', strtotime('today')), // datetime string 'datetime_to' => date('Y-m-d 15:30:00', strtotime('today')), // datetime string 'status' => 'available', // available, reserved, partially-avilable 'text' => 'test free', // display text ], [ 'datetime_from' => date('Y-m-d 09:00:00', strtotime('today')), // datetime string 'datetime_to' => date('Y-m-d 11:15:00', strtotime('today')), // datetime string 'status' => 'reserved', // available, reserved, partially-avilable 'text' => 'test reserved', // display text ], ]; } }