<?php

namespace App\Listeners;

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Spatie\Activitylog\Facades\Activity;

class LogLogoutActivity
{
    /**
     * Create the event listener.
     */
    public function __construct()
    {
        
    }

    /**
     * Handle the event.
     */
    public function handle(object $event): void
    {
        Activity::causedBy($event->user)
            ->withProperties(['ip' => request()->ip()])
            ->inLog('loginInfo')
            ->log('User logged out');
    }
}
