*/ protected function casts(): array { return [ 'title' => 'array', 'body' => 'array', 'is_current' => 'boolean', 'published_at' => 'datetime', ]; } /** * Users that accepted this document version. * * @return BelongsToMany */ public function users(): BelongsToMany { return $this->belongsToMany(User::class, 'user_consents') ->withPivot(['accepted_at', 'ip_address', 'user_agent', 'source']) ->withTimestamps(); } }