| 1 | <?php |
||
| 7 | class RefreshToken extends Model |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The database table used by the model. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $table = 'oauth_refresh_tokens'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Indicates if the IDs are auto-incrementing. |
||
| 18 | * |
||
| 19 | * @var bool |
||
| 20 | */ |
||
| 21 | public $incrementing = false; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * The "type" of the primary key ID. |
||
| 25 | * |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $keyType = 'string'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The guarded attributes on the model. |
||
| 32 | * |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | protected $guarded = []; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * The attributes that should be cast to native types. |
||
| 39 | * |
||
| 40 | * @var array |
||
| 41 | */ |
||
| 42 | protected $casts = [ |
||
| 43 | 'revoked' => 'bool', |
||
| 44 | ]; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * The attributes that should be mutated to dates. |
||
| 48 | * |
||
| 49 | * @var array |
||
| 50 | */ |
||
| 51 | protected $dates = [ |
||
| 52 | 'expires_at', |
||
| 53 | ]; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Indicates if the model should be timestamped. |
||
| 57 | * |
||
| 58 | * @var bool |
||
| 59 | */ |
||
| 60 | public $timestamps = false; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Get the access token that the refresh token belongs to. |
||
| 64 | * |
||
| 65 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 66 | */ |
||
| 67 | public function accessToken() |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Revoke the token instance. |
||
| 74 | * |
||
| 75 | * @return bool |
||
| 76 | */ |
||
| 77 | public function revoke() |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Determine if the token is a transient JWT token. |
||
| 84 | * |
||
| 85 | * @return bool |
||
| 86 | */ |
||
| 87 | public function transient() |
||
| 91 | } |
||
| 92 |