40 lines
780 B
PHP
40 lines
780 B
PHP
<?php
|
|
|
|
namespace App\Models\Auth;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class DingTalkAuthAudit extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
protected $table = 'dingtalk_auth_audits';
|
|
|
|
protected $fillable = [
|
|
'event',
|
|
'outcome',
|
|
'user_id',
|
|
'actor_user_id',
|
|
'union_id_hash',
|
|
'ip_address',
|
|
'metadata',
|
|
'created_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'metadata' => 'array',
|
|
'created_at' => 'datetime',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function actor(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'actor_user_id');
|
|
}
|
|
}
|