update: model observers

This commit is contained in:
HDVinnie
2020-02-12 12:55:17 -05:00
parent 8607387023
commit 5d6edc0ce4
2 changed files with 22 additions and 0 deletions
+11
View File
@@ -42,6 +42,17 @@ class TorrentObserver
Cache::put("torrent.{$torrent->info_hash}", $torrent);
}
/**
* Handle the Torrent "retrieved" event.
*
* @param \App\Models\Torrent $torrent
* @return void
*/
public function retrieved(Torrent $torrent)
{
Cache::add("torrent.{$torrent->info_hash}", $torrent);
}
/**
* Handle the Torrent "deleted" event.
*
+11
View File
@@ -42,6 +42,17 @@ class UserObserver
Cache::put("user.{$user->passkey}", $user);
}
/**
* Handle the User "retrieved" event.
*
* @param \App\Models\User $user
* @return void
*/
public function retrieved(User $user)
{
Cache::add("user.{$user->passkey}", $user);
}
/**
* Handle the User "deleted" event.
*