aboutsummaryrefslogtreecommitdiff
path: root/src/CamilStaps/BotleaguesApi/UserToken.php
blob: 02a8891d7f771a9d6baed9ed2f2eb4a62f832717 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
namespace CamilStaps\BotleaguesApi;

use Illuminate\Database\Eloquent\Model;

class UserToken extends Model {
    
    protected $table = 'user_tokens';
    protected $hidden = ['token'];
    protected $fillable = ['userId', 'token', 'valid_till'];

    public function save(array $options = array()) {
        $this->valid_till = date("Y-m-d H:i:s", time() + 3600);

        return parent::save($options);
    }

}