From bdf893e87b3fa6b34b08c78b060553e3e88f2c82 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 10 May 2015 19:11:07 +0300 Subject: Cleanup; show user_token-token field on store request (POST) --- src/CamilStaps/BotleaguesApi/UserToken.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/CamilStaps/BotleaguesApi/UserToken.php') diff --git a/src/CamilStaps/BotleaguesApi/UserToken.php b/src/CamilStaps/BotleaguesApi/UserToken.php index 02a8891..9909f6a 100644 --- a/src/CamilStaps/BotleaguesApi/UserToken.php +++ b/src/CamilStaps/BotleaguesApi/UserToken.php @@ -9,6 +9,9 @@ class UserToken extends Model { protected $hidden = ['token']; protected $fillable = ['userId', 'token', 'valid_till']; + /** + * Override the parent's save() function to automatically update the valid_till timestamp + */ public function save(array $options = array()) { $this->valid_till = date("Y-m-d H:i:s", time() + 3600); -- cgit v1.2.3