*/ protected $fillable = [ 'user_id', 'legal_document_id', 'document_version', 'ip_address', 'user_agent', 'accepted_at', ]; /** * The attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'accepted_at' => 'datetime', ]; } /** * Get the user that accepted the document. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, \App\Models\UserDocumentAcceptance> */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the legal document that was accepted. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\LegalDocument, \App\Models\UserDocumentAcceptance> */ public function document(): BelongsTo { return $this->belongsTo(LegalDocument::class, 'legal_document_id'); } }