mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 20:18:59 -05:00
update: model observers
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user