Skip to content

Instantly share code, notes, and snippets.

@rodurma
Created June 16, 2015 19:57
Show Gist options
  • Select an option

  • Save rodurma/253afbf0ea90b04fec67 to your computer and use it in GitHub Desktop.

Select an option

Save rodurma/253afbf0ea90b04fec67 to your computer and use it in GitHub Desktop.
Trabalhando com timezones no Laravel usando mutators
public function getCreatedAtAttribute($value)
{
$timezone = Auth::check() ? Auth::user()->timezone : Config::get('app.timezone');
return Carbon::parse($value)->timezone($timezone);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment