mirror of https://github.com/pixelfed/pixelfed
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			65 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
			
		
		
	
	
			65 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
<?php
 | 
						|
 | 
						|
namespace App\Observers;
 | 
						|
 | 
						|
use App\Notification;
 | 
						|
use App\Services\NotificationService;
 | 
						|
 | 
						|
class NotificationObserver
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * Handle the notification "created" event.
 | 
						|
     *
 | 
						|
     * @param  \App\Notification  $notification
 | 
						|
     * @return void
 | 
						|
     */
 | 
						|
    public function created(Notification $notification)
 | 
						|
    {
 | 
						|
        NotificationService::set($notification->profile_id, $notification->id);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Handle the notification "updated" event.
 | 
						|
     *
 | 
						|
     * @param  \App\Notification  $notification
 | 
						|
     * @return void
 | 
						|
     */
 | 
						|
    public function updated(Notification $notification)
 | 
						|
    {
 | 
						|
        NotificationService::set($notification->profile_id, $notification->id);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Handle the notification "deleted" event.
 | 
						|
     *
 | 
						|
     * @param  \App\Notification  $notification
 | 
						|
     * @return void
 | 
						|
     */
 | 
						|
    public function deleted(Notification $notification)
 | 
						|
    {
 | 
						|
        NotificationService::del($notification->profile_id, $notification->id);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Handle the notification "restored" event.
 | 
						|
     *
 | 
						|
     * @param  \App\Notification  $notification
 | 
						|
     * @return void
 | 
						|
     */
 | 
						|
    public function restored(Notification $notification)
 | 
						|
    {
 | 
						|
        NotificationService::set($notification->profile_id, $notification->id);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Handle the notification "force deleted" event.
 | 
						|
     *
 | 
						|
     * @param  \App\Notification  $notification
 | 
						|
     * @return void
 | 
						|
     */
 | 
						|
    public function forceDeleted(Notification $notification)
 | 
						|
    {
 | 
						|
        NotificationService::del($notification->profile_id, $notification->id);
 | 
						|
    }
 | 
						|
}
 |