Make listener methods static

This is needed since we're listening to the individual methods of the class, as opposed to registering the class as a subscriber.
This commit is contained in:
Alexander Skvortsov 2020-12-10 23:35:42 -05:00
parent d2284d9de1
commit a6cae387d7

View File

@ -19,7 +19,7 @@ class SaveLikesToDatabase
/**
* @param Saving $event
*/
public function whenPostIsSaving(Saving $event)
public static function whenPostIsSaving(Saving $event)
{
$post = $event->post;
$data = $event->data;
@ -47,7 +47,7 @@ class SaveLikesToDatabase
/**
* @param Deleted $event
*/
public function whenPostIsDeleted(Deleted $event)
public static function whenPostIsDeleted(Deleted $event)
{
$event->post->likes()->detach();
}