BastionSSO/app/Models/OauthConsent.php

36 lines
674 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class OauthConsent extends Model
{
protected $fillable = [
'user_id',
'client_id',
'scope_fingerprint',
'scopes',
'granted_at',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function client(): BelongsTo
{
return $this->belongsTo(OauthClient::class, 'client_id');
}
protected function casts(): array
{
return [
'scopes' => 'array',
'granted_at' => 'datetime',
];
}
}