PHP code example of guava / calendar

1. Go to this page and download the library: Download guava/calendar 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/ */

    

guava / calendar example snippets


use Guava\Calendar\Filament\CalendarWidget;
use Guava\Calendar\ValueObjects\CalendarEvent;
use Guava\Calendar\ValueObjects\FetchInfo;
use Illuminate\Support\Collection;

class MyCalendarWidget extends CalendarWidget
{
    protected function getEvents(FetchInfo $info): Collection|array
    {
        return [
            CalendarEvent::make()
                ->title('My first event')
                ->start(now())
                ->end(now()->addHours(2)),
        ];
    }
}
bash
php artisan filament:assets