The Laravel Timezones package is a convenient solution for Laravel developers who need to include a dropdown menu of timezones in their applications. This package simplifies the process of incorporating a timezone selection feature, saving developers valuable time and effort.
You can install the package via composer:
composer require baspa/laravel-timezones
use Baspa\Timezones\Facades\Timezones;
//
$groupedTimezones = Timezones::toArray(grouped: true);
use Baspa\Timezones\Facades\Timezones;
//
$timezones = Timezones::toArray();
use Baspa\Timezones\Facades\Timezones;
//
$timezones = Timezones::excludeContinents(['Africa', 'America'])
->toArray();
$timezones = Timezones::showOffset()->toArray();
// or
$timezones = Timezones::showOffset(showOffset: false)->toArray();
To include general timezones like GMT or UTC use the includeGeneral
method.
$timezones = Timezones::includeGeneral()->toArray();
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.