-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.3] Change read to timestamp from boolean #14797
[5.3] Change read to timestamp from boolean #14797
Conversation
Im unsure if this should be |
@@ -52,7 +53,7 @@ public function notifiable() | |||
*/ | |||
public function markAsRead() | |||
{ | |||
$this->forceFill(['read' => true])->save(); | |||
$this->forceFill(['read' => Carbon::now()])->save(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought, could do $this->freshTimestamp()
here instead - would give you a new Carbon instance and save needing to add the use statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never used that before.
Is it done like this:
$this->forceFill(['read' => $this->freshTimestamp()])->save();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - that's the one!
Maybe it should be named |
+1 for |
Could you send PR to docs when you get a chance. Thanks! |
@taylor I have documented this on the docs branch, but there is a merge conflict, so feel free to take the deltas and just apply them yourself :) |
* Change read to timestamp from boolean * Use timestamps not datetime * Dont use carbon, instead use freshTimstamp() * Use read_at not read
No description provided.