belongsTo(Category::class); } /** * Get the summary associated with the book. */ public function summary() { return $this->hasOne(Summary::class); } /** * The authors that belong to the book. */ public function authors() { return $this->belongsToMany(Author::class, 'author_book')->withTimestamps(); } /** * Users who saved this book to their readlist. */ public function savedByUsers() { return $this->belongsToMany(User::class, 'readlist_items')->withTimestamps(); } /** * Reports submitted for this book's summary. */ public function reports() { return $this->hasMany(SummaryReport::class); } /** * Reviews left by users for this book's summary. */ public function reviews() { return $this->hasMany(SummaryReview::class); } }