Search by

breadthe / laravel-starter-timezone

breadthe

Timezone scaffolding for Laravel's Livewire starter kit.

Package info

github.com/breadthe/laravel-starter-timezone

pkg:composer/breadthe/laravel-starter-timezone

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-09-11 18:51 UTC

This package is auto-updated.

Last update: 2026-09-11 18:57:21 UTC


README

Tests

🚨This project is 100% vibe-engineered! It's strictly meant for my own consumption. Use at your own risk!

Adds a user's IANA timezone to a fresh Laravel Livewire starter-kit application.

The installer creates a reversible users.timezone migration and safely scaffolds timezone controls into the Fortify registration action, the registration page, and the Livewire profile settings page. The browser detects a supported IANA timezone automatically; UTC is the reliable fallback.

Supported applications

This is intentionally not a general-purpose timezone package. It is for a Laravel application scaffolded with the Livewire starter kit and its Laravel Fortify-based authentication.

  • PHP 8.3+
  • Laravel 12 or 13 with the current Livewire 4 starter-kit structure
  • Laravel Fortify registration (the starter kit's standard App\Actions\Fortify\CreateNewUser action)
  • Livewire 4 and Flux UI, using the starter kit's full-page profile component at resources/views/pages/settings/profile.blade.php (with or without Livewire's âš¡ filename prefix)
  • Laravel's standard database-backed user authentication

It does not support WorkOS, Inertia, React, Livewire 3 / Volt-era starter kits, API-only Fortify, a custom authentication action, or a heavily customized starter-kit profile page. Those integrations need a purpose-built installer rather than a fragile patcher.

Install it immediately after scaffolding, before changing the auth views or profile component. The command recognizes the current Laravel 12/13 Livewire starter-kit registration view at either resources/views/auth/register.blade.php or resources/views/pages/auth/register.blade.php.

Compatible project scaffolding

When creating a fresh Laravel project, choose the Livewire frontend stack and Laravel's built-in authentication:

Compatible Laravel project scaffolding selections

Compatible Laravel authentication feature selections

Installation

composer require breadthe/laravel-starter-timezone
php artisan starter-timezone:install

The interactive command presents one multi-select prompt. All three operations are selected by default; use Space to toggle an operation and Enter to continue:

  • Add a timezone string column to users, defaulting to UTC.
  • Add a timezone select field to registration, including browser detection.
  • Add a timezone select field and a Detect button to /settings/profile.

Finish by running the migration:

php artisan migrate

Migration command output

For unattended provisioning, no option is needed: non-interactive runs select all three operations.

php artisan starter-timezone:install --no-interaction

To apply only one surface, pass one or more selection flags:

php artisan starter-timezone:install --migration
php artisan starter-timezone:install --registration --profile

The installer stops before writing anything if it cannot recognize a required starter-kit file. It also refuses to patch a file that already mentions timezone, protecting hand-written changes. Review that file first; only then use --force if you want the installer to continue with the remaining supported changes.

Installer walkthrough

Interactive installer walkthrough

What it looks like

After installing the package and running the migration, the standard Laravel Livewire starter-kit screens include the timezone field on registration and in profile settings.

Registration

Registration page with timezone selection

Profile settings

Profile settings with timezone selection and detection

What is generated

The migration is conventional and reversible:

Schema::table('users', function (Blueprint $table) {
    $table->string('timezone')->default('UTC');
});

When registration is selected, the installer:

  • makes timezone fillable on App\Models\User (supporting both Laravel's usual $fillable property and Chisel's #[Fillable] attribute);
  • validates registration and profile submissions against DateTimeZone::listIdentifiers();
  • stores the submitted registration timezone; and
  • renders dropdowns populated with IANA timezone names.

The profile field uses Livewire's normal model binding. Its Detect button dispatches a bubbling change event after setting the browser-detected zone so Livewire receives the update.

Development

composer install
composer format
composer test

The test suite verifies each source transformation and the non-interactive installer. GitHub Actions tests supported Laravel 12 and 13 releases on PHP 8.3, 8.4, and 8.5, and checks formatting before running Pest.

Release checklist

Before tagging a release, test against a freshly scaffolded Livewire starter kit for every Laravel version listed above. The installer deliberately relies on starter-kit file structure, so a starter-kit template change is a compatibility event and should be covered with a fixture and CI matrix entry before being advertised as supported.

License

The MIT License (MIT). See LICENSE.md.