<?php

namespace Koneko\VuexyAdminModule\App\Listeners;

use Illuminate\Auth\Events\Logout;
use Illuminate\Support\Facades\Log;
use Koneko\VuexyAdminModule\App\Services\VuexyAdminService;

class ClearUserCache
{
    /**
     * Handle the event.
     *
     * @return void
     */
    public function handle(Logout $event)
    {
        if ($event->user) {
            VuexyAdminService::clearUserMenuCache();
            VuexyAdminService::clearSearchMenuCache();
            VuexyAdminService::clearQuickLinksCache();
            VuexyAdminService::clearNotificationsCache();
        }
    }
}
