PHPackages                             kodventure/has-timezoned-attributes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kodventure/has-timezoned-attributes

ActiveLibrary

kodventure/has-timezoned-attributes
===================================

Automatically adds \*\_tz attributes to Eloquent models for timestamp fields, based on the user's or application's timezone.

v1.0.1(1y ago)01MITPHPPHP ^8.0

Since Apr 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Kodventure/has-timezoned-attributes)[ Packagist](https://packagist.org/packages/kodventure/has-timezoned-attributes)[ RSS](/packages/kodventure-has-timezoned-attributes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

HasTimezonedAttributes for Laravel
==================================

[](#hastimezonedattributes-for-laravel)

Automatically adds \*\_tz attributes to your Eloquent models for timestamp fields, based on the user's or application's timezone.

Installation
------------

[](#installation)

```
composer require kodventure/has-timezoned-attributes

```

Usage
-----

[](#usage)

Add the trait to any model:

```
use Kodventure\HasTimezonedAttributes\HasTimezonedAttributes;

class User extends Model
{
    use HasTimezonedAttributes;

    protected $casts = [
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
        'last_login_at' => 'datetime',
    ];
}
```

Then access:

```
$user->created_at_tz;
$user->last_login_at_tz;
$user->email_verified_at_tz;
$user->getEmailVerifiedAtTzAttribute();
$user->getEmailVerifiedAtTz();
```

Timezone Resolution
-------------------

[](#timezone-resolution)

- If a user is authenticated, their `timezone` attribute is used.
- If no user is authenticated, the `app.timezone` config value is used.
- You can override the timezone on a per-model basis by adding a `getTimezone()` method to your model.

---

> Thanks to GPT-4.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance49

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf50caa92c9f913dfe829992241cc76e004734651b4c2caaaebde6ff35655cf1?d=identicon)[hcivelek](/maintainers/hcivelek)

---

Top Contributors

[![hcivelek](https://avatars.githubusercontent.com/u/371721?v=4)](https://github.com/hcivelek "hcivelek (8 commits)")

### Embed Badge

![Health badge](/badges/kodventure-has-timezoned-attributes/health.svg)

```
[![Health](https://phpackages.com/badges/kodventure-has-timezoned-attributes/health.svg)](https://phpackages.com/packages/kodventure-has-timezoned-attributes)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[illuminatech/balance

Provides support for Balance accounting system based on debit and credit principle

16137.4k](/packages/illuminatech-balance)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
