Last active
May 12, 2016 12:13
-
-
Save 0x1ad2/65fa0b75341002d04c8d037f45c00fce to your computer and use it in GitHub Desktop.
Dutch date mutator eloquent model
This file contains 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 | |
/** | |
* Get created at attribute and mutate to Dutch format and Dutch timezone | |
*/ | |
public function getCreatedAtAttribute($date) | |
{ | |
return \Carbon::createFromFormat('Y-m-d H:i:s', $date)->copy()->tz('Europe/Amsterdam')->format('d-m-Y H:i:s'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment