PHP code example of roundly-consulting / appointments-for-laravel

1. Go to this page and download the library: Download roundly-consulting/appointments-for-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

roundly-consulting / appointments-for-laravel example snippets


use RoundlyConsulting\Appointments\Enums\ParticipantRole;
use RoundlyConsulting\Appointments\Facades\Appointments;

$appointment = Appointments::schedule('Project kickoff')
    ->startingAt('2026-07-01 17:30', timezone: 'Europe/Bratislava')
    ->lasting(90)                                   // minutes; or ->until('2026-07-01 19:00')
    ->withParticipant($host, ParticipantRole::Organiser)
    ->withParticipant($guest)
    ->preventConflicts()                            // refuse a double-booking
    ->create();

use Carbon\CarbonImmutable;

$booking = Appointments::for($appointment);

$booking->confirm();                                                // pending → confirmed
$booking->reschedule(CarbonImmutable::parse('2026-07-02 10:00'));   // keeps the duration
$booking->participants()->add($colleague);

Appointments::isAvailable($guest, $appointment->starts_at, $appointment->ends_at); // false
$booking->ics();                                                    // an RFC 5545 calendar
bash
composer vendor:publish --tag="appointments-migrations"
php artisan vendor:publish --tag="approvals-migrations" --tag="contacts-migrations" --tag="reviews-migrations" --tag="media-migrations"
php artisan migrate