PHP code example of tapp / filament-timezone-field
1. Go to this page and download the library: Download tapp/filament-timezone-field 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/ */
tapp / filament-timezone-field example snippets
use Tapp\FilamentTimezoneField\Forms\Components\TimezoneSelect;
public static function form(Form $form): Form
{
return $form
->schema([
// ...
TimezoneSelect::make('timezone'),
// ...
]);
}
use Tapp\FilamentTimezoneField\Forms\Components\TimezoneSelect;
public static function form(Form $form): Form
{
return $form
->schema([
// ...
TimezoneSelect::make('timezone')
->timezoneType('GMT'),
// ...
]);
}
use Tapp\FilamentTimezoneField\Enums\Region;
TimezoneSelect::make('timezone')
->byRegion(Region::Australia)
use DateTimeZone;
TimezoneSelect::make('timezone')
->byRegion(DateTimeZone::AUSTRALIA)
use Tapp\FilamentTimezoneField\Enums\Region;
TimezoneSelect::make('timezone')
->byRegion([Region::Australia, Region::America])
> use Tapp\FilamentTimezoneField\Forms\Components\TimezoneSelect;
>
> public static function form(Form $form): Form
> {
> return $form
> ->schema([
> // ...
> TimezoneSelect::make('timezone')
> ->searchable()
> ->
use Tapp\FilamentTimezoneField\Forms\Components\TimezoneSelect;
public static function form(Form $form): Form
{
return $form
->schema([
// ...
TimezoneSelect::make('timezone')
->hideNames(),
// ...
]);
}
use Tapp\FilamentTimezoneField\Forms\Components\TimezoneSelect;
public static function form(Form $form): Form
{
return $form
->schema([
// ...
TimezoneSelect::make('timezone')
->hideOffset(),
// ...
]);
}
use Tapp\FilamentTimezoneField\Tables\Columns\TimezoneColumn;
public static function table(Table $table): Table
{
return $table
->columns([
//...
TimezoneColumn::make('timezone')
->timezoneType('GMT')
->formattedOffsetAndTimezone(),
])
// ...
}
use Tapp\FilamentTimezoneField\Tables\Filters\TimezoneSelectFilter;
public static function table(Table $table): Table
{
return $table
//...
->filters([
TimezoneSelectFilter::make('timezone'),
// ...
])
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.