Last active
October 5, 2021 22:37
-
-
Save morrislaptop/42346216229c52d8324d926effe766c8 to your computer and use it in GitHub Desktop.
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 getCurrentStatusAttribute() | |
{ | |
if ($this->status === 'published') { | |
return $this->publish_date?->lessThan(now()) ? 'published' : 'future'; | |
} | |
return $status; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment