steelants/booking

Livewire booking calendar

0.0.7 2024-05-17 07:17 UTC

This package is auto-updated.

Last update: 2024-05-17 07:17:48 UTC


README

Created by: SteelAnts s.r.o.

Total Downloads

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
            ],
        ];
    }
}

Contributors

68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d737465656c616e74732f4c697665776972652d426f6f6b696e67

Other Packages

steelants/laravel-auth

steelants/laravel-boilerplate

steelants/datatable

steelants/form

steelants/modal

steelants/laravel-tenant