1. Go to this page and download the library: Download coolsam/flatpickr 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/ */
coolsam / flatpickr example snippets
use Coolsam\Flatpickr\Forms\Components\Flatpickr;
Flatpickr::make('published_at')
->format('Y-m-d')
->minDate(today()->startOfYear())
->maxDate(today());
Flatpickr::make('starts_at')
->label('Event schedule')
->rangePicker()
->rangeEnd('ends_at')
->time(true)
->format('Y-m-d H:i') // saved to starts_at / ends_at
->displayFormat('M j, Y h:i K') // e.g. Jun 14, 2024 7:00 AM to Jun 17, 2024 5:00 PM
->rangeSeparator(' to ');
use Coolsam\Flatpickr\Enums\FlatpickrTheme;
return [
'theme' => FlatpickrTheme::DEFAULT, // recommended
];
bash
php artisan flatpickr:install
bash
php artisan filament:upgrade
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.