Created
October 6, 2022 18:00
-
-
Save dannetstudio/6f25eb1f08e69f2c54a3596048844ae6 to your computer and use it in GitHub Desktop.
Models user timezone Accessors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function getCreatedAtAttribute($value): Carbon | |
| { | |
| return Carbon::parse($value)->timezone(Helpers::getUserTimeZone()); | |
| } | |
| public function getUpdatedAtAttribute($value): Carbon | |
| { | |
| return Carbon::parse($value)->timezone(Helpers::getUserTimeZone()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment