mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 23:52:40 +01:00
3de55ee645
Base logic in place but needs review and refactor to see if can better fit into Laravel using 'Guard' system. Currently has issues due to cookies in use from active session on API.
22 lines
465 B
PHP
22 lines
465 B
PHP
<?php namespace BookStack\Api;
|
|
|
|
use BookStack\Auth\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ApiToken extends Model
|
|
{
|
|
protected $fillable = ['name', 'expires_at'];
|
|
protected $casts = [
|
|
'expires_at' => 'date:Y-m-d'
|
|
];
|
|
|
|
/**
|
|
* Get the user that this token belongs to.
|
|
*/
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|