This commit is contained in:
User
2025-02-07 18:24:52 -05:00
parent 75d4a616dd
commit b7f9b0aff7
17 changed files with 304 additions and 245 deletions

View File

@@ -55,16 +55,25 @@ class User extends Authenticatable implements MustVerifyEmail
];
}
/**
* @return BelongsToMany
*/
public function favourites(): BelongsToMany
{
return $this->belongsToMany(Comic::class, 'user_favourite')->withTimestamps();
}
/**
* @return BelongsToMany
*/
public function readingHistories(): BelongsToMany
{
return $this->belongsToMany(Chapter::class, 'reading_histories')->withTimestamps();
}
/**
* @return array
*/
public function cleanUpReadingHistories(): array
{
// Get the user's ID