Skip to content

Instantly share code, notes, and snippets.

@dannetstudio
Created October 6, 2022 17:39
Show Gist options
  • Select an option

  • Save dannetstudio/8bb153a34f374b601e40793b35b8e2d9 to your computer and use it in GitHub Desktop.

Select an option

Save dannetstudio/8bb153a34f374b601e40793b35b8e2d9 to your computer and use it in GitHub Desktop.
setTimeZoneAttribute Mutator
<?php
public function setTimeZoneAttribute($value) {
$this->attributes['timezone'] = $value == config('app.timezone') || is_null($value) ? null : $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment