<?php namespace BookStack\Auth;
+use BookStack\Actions\Favourite;
use BookStack\Api\ApiToken;
use BookStack\Entities\Tools\SlugGenerator;
use BookStack\Interfaces\Loggable;
return $this->hasMany(ApiToken::class);
}
+ /**
+ * Get the favourite instances for this user.
+ */
+ public function favourites(): HasMany
+ {
+ return $this->hasMany(Favourite::class);
+ }
+
/**
* Get the last activity time for this user.
*/
{
$user->socialAccounts()->delete();
$user->apiTokens()->delete();
+ $user->favourites()->delete();
$user->delete();
// Delete user profile images
$entity->jointPermissions()->delete();
$entity->searchTerms()->delete();
$entity->deletions()->delete();
+ $entity->favourites()->delete();
if ($entity instanceof HasCoverImage && $entity->cover) {
$imageService = app()->make(ImageService::class);