]> BookStack Code Mirror - bookstack/blob - app/Api/ApiToken.php
cdcb33a7bf2a65646bf4a67a91d1239c6ad55063
[bookstack] / app / Api / ApiToken.php
1 <?php namespace BookStack\Api;
2
3 use BookStack\Auth\User;
4 use Illuminate\Database\Eloquent\Model;
5 use Illuminate\Database\Eloquent\Relations\BelongsTo;
6
7 class ApiToken extends Model
8 {
9     protected $fillable = ['name', 'expires_at'];
10     protected $casts = [
11         'expires_at' => 'date:Y-m-d'
12     ];
13
14     /**
15      * Get the user that this token belongs to.
16      */
17     public function user(): BelongsTo
18     {
19         return $this->belongsTo(User::class);
20     }
21 }