Download the PHP package mixudev/laravel-timezone without Composer

On this page you can find all versions of the php package mixudev/laravel-timezone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-timezone

Laravel Timezone (mixudev/laravel-timezone)

Versi Terbaru di Packagist Status Pengujian GitHub Total Unduhan

Sistem resolusi dan konversi timezone otomatis, akurat, ringan, dan universal untuk aplikasi Laravel.

Dirancang dengan prinsip client-first, tanpa migrasi database, tanpa dependensi API eksternal, dan hemat beban server. Mendukung penuh aplikasi Monolith (Blade), REST API, SPA, Inertia.js (Vue/React), Livewire, Queue Worker, hingga Laravel Octane.


Fitur Utama


Instalasi

Pasang package melalui Composer:

Publikasikan konfigurasi, view Blade, dan aset JavaScript (opsional):

Atau publikasikan file tertentu saja:


Konfigurasi Ringkas

File konfigurasi config/timezone.php menyediakan pengaturan yang bersih dan siap pakai:


Urutan Resolusi Timezone

Resolver bekerja berdasarkan hierarki prioritas berurutan:

  1. Explicit Override: Ditentukan langsung oleh developer melalui Timezone::in() atau Timezone::setExplicit().
  2. Client HTTP Header: Header X-Timezone yang dikirim dari browser atau API client.
  3. Client Cookie: Cookie timezone yang tersimpan pada browser pengguna.
  4. Authenticated User: Provider timezone pengguna via Timezone::useUserProvider() atau atribut $user->timezone.
  5. Session Storage: Data timezone pada session session('timezone') (jika diaktifkan).
  6. IP Geolocation: Resolver kustom IP (jika diaktifkan).
  7. Config Default: Nilai dari config('timezone.default') atau config('app.timezone').
  8. UTC Fallback: UTC sebagai jaminan akhir server.

Integrasi Sisi Browser (JavaScript Client)

Muat skrip klien berukuran kurang dari 2KB tanpa dependensi eksternal di layout utama Anda (misal resources/views/layouts/app.blade.php):

Atau impor ke dalam file bundle JavaScript (Vite / Webpack):

Mekanisme Otomatis Script Klien:

  1. Membaca timezone browser lokal menggunakan Intl.DateTimeFormat().resolvedOptions().timeZone.
  2. Menyimpan timezone di localStorage dan cookie berstatus SameSite=Lax.
  3. Menambahkan header X-Timezone pada setiap request fetch() dan axios.
  4. Mendukung auto-header pada event visit Inertia.js dan melakukan hidrasi elemen DOM pada navigasi Livewire.

Penggunaan pada Blade

1. Komponen Progressive Enhancement

Gunakan komponen <x-local-time> untuk merender elemen HTML <time>. Komponen ini menampilkan teks server-side sebagai fallback dan langsung terhidrasi ke waktu lokal browser saat JavaScript aktif:

2. Direktif Blade


Global Helper


Facade API


Provider Timezone Pengguna

Jika aplikasi Anda menyimpan preferensi timezone pada model User, daftarkan provider kustom di dalam method boot() pada AppServiceProvider:


Middleware

Untuk memastikan timezone diinisialisasi sebelum kontroler atau middleware lain dijalankan:


Keamanan untuk Octane, Queue, dan CLI

Aplikasi dengan worker jangka panjang (Laravel Octane, RoadRunner, FrankenPHP, Swoole, dan Queue Worker) menggunakan memori yang persisten lintas request.

Package ini didaftarkan dengan scoped container lifecycle:


Perintah Artisan

Perintah CLI diagnostik dan pemeliharaan:


Dokumentasi Lengkap

Panduan mendalam tersedia pada folder docs/:


Pengujian

Jalankan rangkaian unit & feature test:

Jalankan analisis statis PHPStan:


Lisensi

Lisensi MIT. Silakan merujuk ke file LICENSE untuk informasi lebih lanjut.


All versions of laravel-timezone with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^10.0|^11.0|^12.0|^13.0
nesbot/carbon Version ^2.62|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mixudev/laravel-timezone contains the following files

Loading the files please wait ...